summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c20
-rw-r--r--sys/net/if_ppp.c16
-rw-r--r--sys/net/rtsock.c6
3 files changed, 32 insertions, 10 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 6507bf5..3dabc65 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id: if.c,v 1.6 1994/08/18 22:35:19 wollman Exp $
+ * $Id: if.c,v 1.7 1994/09/16 05:47:03 phk Exp $
*/
#include <sys/param.h>
@@ -43,6 +43,7 @@
#include <sys/protosw.h>
#include <sys/kernel.h>
#include <sys/ioctl.h>
+#include <sys/errno.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -621,10 +622,19 @@ ifconf(cmd, data)
ifrp = ifc->ifc_req;
ep = ifr.ifr_name + sizeof (ifr.ifr_name) - 2;
for (; space > sizeof (ifr) && ifp; ifp = ifp->if_next) {
- strncpy(ifr.ifr_name, ifp->if_name, sizeof (ifr.ifr_name) - 2);
- for (cp = ifr.ifr_name; cp < ep && *cp; cp++)
- continue;
- *cp++ = '0' + ifp->if_unit; *cp = '\0';
+ char workbuf[12], *unitname;
+ int unitlen, ifnlen;
+
+ unitname = sprint_d(ifp->if_unit, workbuf, sizeof workbuf);
+ unitlen = strlen(unitname);
+ ifnlen = strlen(ifp->if_name);
+ if(unitlen + ifnlen + 1 > sizeof ifr.ifr_name) {
+ error = ENAMETOOLONG;
+ } else {
+ strcpy(ifr.ifr_name, ifp->if_name);
+ strcpy(&ifr.ifr_name[ifnlen], unitname);
+ }
+
if ((ifa = ifp->if_addrlist) == 0) {
bzero((caddr_t)&ifr.ifr_addr, sizeof(ifr.ifr_addr));
error = copyout((caddr_t)&ifr, (caddr_t)ifrp,
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 19d5965..52af32c 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -69,7 +69,7 @@
* Paul Mackerras (paulus@cs.anu.edu.au).
*/
-/* $Id: if_ppp.c,v 1.7 1994/01/25 05:56:06 deraadt Exp paulus $ */
+/* $Id: if_ppp.c,v 1.2 1994/09/23 00:13:18 wollman Exp $ */
/* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
#include "ppp.h"
@@ -192,7 +192,7 @@ pppattach()
sc->sc_if.if_name = "ppp";
sc->sc_if.if_unit = i++;
sc->sc_if.if_mtu = PPP_MTU;
- sc->sc_if.if_flags = IFF_POINTOPOINT;
+ sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
sc->sc_if.if_type = IFT_PPP;
sc->sc_if.if_hdrlen = PPP_HDRLEN;
sc->sc_if.if_ioctl = pppioctl;
@@ -1489,6 +1489,18 @@ pppioctl(ifp, cmd, data)
case SIOCGIFMTU:
ifr->ifr_mtu = sc->sc_if.if_mtu;
break;
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ switch(ifr->ifr_addr.sa_family) {
+#ifdef INET
+ case AF_INET:
+ break;
+#endif
+ default:
+ error = EAFNOSUPPORT;
+ break;
+ }
+ break;
default:
error = EINVAL;
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 897debc..5653471 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)rtsock.c 8.3 (Berkeley) 1/4/94
- * $Id: rtsock.c,v 1.3 1994/08/02 07:46:44 davidg Exp $
+ * $Id: rtsock.c,v 1.4 1994/10/04 06:49:53 phk Exp $
*/
#include <sys/param.h>
@@ -544,7 +544,7 @@ rt_ifmsg(ifp)
return;
ifm = mtod(m, struct if_msghdr *);
ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = ifp->if_flags;
+ ifm->ifm_flags = (u_short)ifp->if_flags;
ifm->ifm_data = ifp->if_data;
ifm->ifm_addrs = 0;
route_proto.sp_protocol = 0;
@@ -674,7 +674,7 @@ sysctl_iflist(af, w)
ifm = (struct if_msghdr *)w->w_tmem;
ifm->ifm_index = ifp->if_index;
- ifm->ifm_flags = ifp->if_flags;
+ ifm->ifm_flags = (u_short)ifp->if_flags;
ifm->ifm_data = ifp->if_data;
ifm->ifm_addrs = info.rti_addrs;
if (error = copyout((caddr_t)ifm, w->w_where, len))
OpenPOWER on IntegriCloud