From f1e94c6f29b079e4ad9d9305ef3e90a719bcbbda Mon Sep 17 00:00:00 2001 From: brooks Date: Fri, 31 Oct 2003 18:32:15 +0000 Subject: Replace the if_name and if_unit members of struct ifnet with new members if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname) --- sys/netipx/ipx_ip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/netipx') diff --git a/sys/netipx/ipx_ip.c b/sys/netipx/ipx_ip.c index 4fa0bfa..d069fb9 100644 --- a/sys/netipx/ipx_ip.c +++ b/sys/netipx/ipx_ip.c @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include static struct ifnet ipxipif; +static int ipxipif_units; /* list of all hosts and gateways or broadcast addrs */ static struct ifnet_en *ipxip_list; @@ -94,7 +95,7 @@ ipxipattach() if (ipxipif.if_mtu == 0) { ifp = &ipxipif; - ifp->if_name = "ipxip"; + if_initname(ifp, "ipxip", ipxipif_units); ifp->if_mtu = LOMTU; ifp->if_ioctl = ipxipioctl; ifp->if_output = ipxipoutput; @@ -109,13 +110,12 @@ ipxipattach() ipxip_list = m; ifp = &m->ifen_ifnet; - ifp->if_name = "ipxip"; + if_initname(ifp, "ipxip", ipxipif_units++); ifp->if_mtu = LOMTU; ifp->if_ioctl = ipxipioctl; ifp->if_output = ipxipoutput; ifp->if_start = ipxipstart; ifp->if_flags = IFF_POINTOPOINT; - ifp->if_unit = ipxipif.if_unit++; if_attach(ifp); return (m); @@ -379,7 +379,7 @@ ipxip_route(so, sopt) /* * now configure this as a point to point link */ - ifr_ipxip.ifr_name[4] = '0' + ipxipif.if_unit - 1; + ifr_ipxip.ifr_name[4] = '0' + ipxipif_units - 1; ifr_ipxip.ifr_dstaddr = *(struct sockaddr *)ipx_dst; ipx_control(so, (int)SIOCSIFDSTADDR, (caddr_t)&ifr_ipxip, (struct ifnet *)ifn, sopt->sopt_td); -- cgit v1.1