summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2005-11-11 07:36:14 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2005-11-11 07:36:14 +0000
commitd09ed26fd80ce9c7bfbce9a4b89f352e610d8abc (patch)
tree4d7e562715c0e571dbcf93217dd79abe8f2fb3dd /sys
parenta0e82eba5d6abf7cff5971e4d6d72034020df8de (diff)
downloadsrc-test2-d09ed26fd80ce9c7bfbce9a4b89f352e610d8abc.tar.gz
src-test2-d09ed26fd80ce9c7bfbce9a4b89f352e610d8abc.zip
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/contrib/dev/oltr/if_oltr.c3
-rw-r--r--sys/dev/an/if_an.c6
-rw-r--r--sys/dev/owi/if_owi.c5
-rw-r--r--sys/dev/pdq/if_fea.c5
-rw-r--r--sys/dev/pdq/if_fpa.c5
-rw-r--r--sys/dev/pdq/pdq_freebsd.h2
-rw-r--r--sys/dev/pdq/pdq_ifsubr.c4
-rw-r--r--sys/net/fddi.h2
-rw-r--r--sys/net/if.c10
-rw-r--r--sys/net/if_arp.h2
-rw-r--r--sys/net/if_ethersubr.c15
-rw-r--r--sys/net/if_fddisubr.c6
-rw-r--r--sys/net/if_iso88025subr.c5
-rw-r--r--sys/net/if_vlan.c20
-rw-r--r--sys/net/iso88025.h2
-rw-r--r--sys/sys/param.h2
16 files changed, 25 insertions, 69 deletions
diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c
index ced116c585c4..b68c355e207f 100644
--- a/sys/contrib/dev/oltr/if_oltr.c
+++ b/sys/contrib/dev/oltr/if_oltr.c
@@ -173,7 +173,6 @@ oltr_attach(device_t dev)
ifp->if_ioctl = oltr_ioctl;
ifp->if_flags = IFF_BROADCAST | IFF_NEEDSGIANT;
ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
- bcopy(sc->config.macaddress, IFP2ENADDR(sc->ifp), sizeof(sc->config.macaddress));
/*
* Do ifmedia setup.
@@ -203,7 +202,7 @@ oltr_attach(device_t dev)
* Attach the interface
*/
- iso88025_ifattach(ifp, ISO88025_BPF_SUPPORTED);
+ iso88025_ifattach(ifp, sc->config.macaddress, ISO88025_BPF_SUPPORTED);
return(0);
}
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index b2e356f6781a..18b75c3960be 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -113,7 +113,6 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_arp.h>
#include <net/ethernet.h>
-#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/if_media.h>
@@ -1726,8 +1725,6 @@ an_alloc_nicmem(struct an_softc *sc, int len, int *id)
static void
an_setdef(struct an_softc *sc, struct an_req *areq)
{
- struct sockaddr_dl *sdl;
- struct ifaddr *ifa;
struct ifnet *ifp;
struct an_ltv_genconfig *cfg;
struct an_ltv_ssidlist_new *ssid;
@@ -1740,11 +1737,8 @@ an_setdef(struct an_softc *sc, struct an_req *areq)
case AN_RID_GENCONFIG:
cfg = (struct an_ltv_genconfig *)areq;
- ifa = ifaddr_byindex(ifp->if_index);
- sdl = (struct sockaddr_dl *)ifa->ifa_addr;
bcopy((char *)&cfg->an_macaddr, IFP2ENADDR(sc->an_ifp),
ETHER_ADDR_LEN);
- bcopy((char *)&cfg->an_macaddr, LLADDR(sdl), ETHER_ADDR_LEN);
bcopy((char *)cfg, (char *)&sc->an_config,
sizeof(struct an_ltv_genconfig));
diff --git a/sys/dev/owi/if_owi.c b/sys/dev/owi/if_owi.c
index b0f546968348..349d85e08a4f 100644
--- a/sys/dev/owi/if_owi.c
+++ b/sys/dev/owi/if_owi.c
@@ -1239,19 +1239,14 @@ wi_setdef(sc, wreq)
struct wi_softc *sc;
struct wi_req *wreq;
{
- struct sockaddr_dl *sdl;
- struct ifaddr *ifa;
struct ifnet *ifp;
ifp = sc->ifp;
switch(wreq->wi_type) {
case WI_RID_MAC_NODE:
- ifa = ifaddr_byindex(ifp->if_index);
- sdl = (struct sockaddr_dl *)ifa->ifa_addr;
bcopy((char *)&wreq->wi_val, (char *)&IFP2ENADDR(sc->ifp),
ETHER_ADDR_LEN);
- bcopy((char *)&wreq->wi_val, LLADDR(sdl), ETHER_ADDR_LEN);
break;
case WI_RID_PORTTYPE:
sc->wi_ptype = le16toh(wreq->wi_val[0]);
diff --git a/sys/dev/pdq/if_fea.c b/sys/dev/pdq/if_fea.c
index 68dbf139e5a2..19ba31e1d3dc 100644
--- a/sys/dev/pdq/if_fea.c
+++ b/sys/dev/pdq/if_fea.c
@@ -43,7 +43,6 @@
#include <sys/rman.h>
#include <net/if.h>
-#include <net/if_arp.h>
#include <net/if_media.h>
#include <net/fddi.h>
@@ -243,9 +242,7 @@ pdq_eisa_attach (dev)
goto bad;
}
- bcopy((caddr_t) sc->sc_pdq->pdq_hwaddr.lanaddr_bytes,
- (caddr_t) IFP2ENADDR(sc->ifp), FDDI_ADDR_LEN);
- pdq_ifattach(sc);
+ pdq_ifattach(sc, sc->sc_pdq->pdq_hwaddr.lanaddr_bytes);
return (0);
bad:
diff --git a/sys/dev/pdq/if_fpa.c b/sys/dev/pdq/if_fpa.c
index 1cca08e668ae..c44409f4f704 100644
--- a/sys/dev/pdq/if_fpa.c
+++ b/sys/dev/pdq/if_fpa.c
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
#include <sys/rman.h>
#include <net/if.h>
-#include <net/if_arp.h>
#include <net/if_media.h>
#include <net/fddi.h>
@@ -166,9 +165,7 @@ pdq_pci_attach(device_t dev)
goto bad;
}
- bcopy((caddr_t) sc->sc_pdq->pdq_hwaddr.lanaddr_bytes,
- (caddr_t) IFP2ENADDR(sc->ifp), FDDI_ADDR_LEN);
- pdq_ifattach(sc);
+ pdq_ifattach(sc, sc->sc_pdq->pdq_hwaddr.lanaddr_bytes);
return (0);
bad:
diff --git a/sys/dev/pdq/pdq_freebsd.h b/sys/dev/pdq/pdq_freebsd.h
index ef38138ecc04..d6932fb5499e 100644
--- a/sys/dev/pdq/pdq_freebsd.h
+++ b/sys/dev/pdq/pdq_freebsd.h
@@ -260,7 +260,7 @@ pdq_state_t pdq_stop (pdq_t *pdq);
* OS dependent functions provided by
* pdq_ifsubr.c or pdq.c to the bus front ends
*/
-void pdq_ifattach (pdq_softc_t *);
+void pdq_ifattach (pdq_softc_t *, const pdq_uint8_t *);
void pdq_ifdetach (pdq_softc_t *);
void pdq_free (device_t);
int pdq_interrupt (pdq_t *pdq);
diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c
index 409779a7df5d..68e13ba7a089 100644
--- a/sys/dev/pdq/pdq_ifsubr.c
+++ b/sys/dev/pdq/pdq_ifsubr.c
@@ -410,7 +410,7 @@ pdq_ifioctl(
#endif
void
-pdq_ifattach(pdq_softc_t *sc)
+pdq_ifattach(pdq_softc_t *sc, const pdq_uint8_t *llc)
{
struct ifnet *ifp;
@@ -441,7 +441,7 @@ pdq_ifattach(pdq_softc_t *sc)
}
#endif
- fddi_ifattach(ifp, FDDI_BPF_SUPPORTED);
+ fddi_ifattach(ifp, llc, FDDI_BPF_SUPPORTED);
}
void
diff --git a/sys/net/fddi.h b/sys/net/fddi.h
index a488f29a0c4a..869a8d93b7ed 100644
--- a/sys/net/fddi.h
+++ b/sys/net/fddi.h
@@ -97,7 +97,7 @@ struct fddi_header {
#define FDDI_BPF_UNSUPPORTED 0
#define FDDI_BPF_SUPPORTED 1
-void fddi_ifattach(struct ifnet *, int);
+void fddi_ifattach(struct ifnet *, const u_int8_t *, int);
void fddi_ifdetach(struct ifnet *, int);
int fddi_ioctl(struct ifnet *, int, caddr_t);
diff --git a/sys/net/if.c b/sys/net/if.c
index 31d286b30481..be7b842b08fd 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -59,7 +59,6 @@
#include <machine/stdarg.h>
#include <net/if.h>
-#include <net/if_arp.h>
#include <net/if_clone.h>
#include <net/if_dl.h>
#include <net/if_types.h>
@@ -2101,19 +2100,12 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len)
if (len != sdl->sdl_alen) /* don't allow length to change */
return (EINVAL);
switch (ifp->if_type) {
- case IFT_ETHER: /* these types use struct arpcom */
+ case IFT_ETHER:
case IFT_FDDI:
case IFT_XETHER:
case IFT_ISO88025:
case IFT_L2VLAN:
case IFT_BRIDGE:
- bcopy(lladdr, IFP2ENADDR(ifp), len);
- /*
- * XXX We also need to store the lladdr in LLADDR(sdl),
- * which is done below. This is a pain because we must
- * remember to keep the info in sync.
- */
- /* FALLTHROUGH */
case IFT_ARCNET:
bcopy(lladdr, LLADDR(sdl), len);
break;
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h
index 9aa63c626641..c9cd15f9f619 100644
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -103,7 +103,7 @@ struct arpreq {
*/
struct arpcom {
struct ifnet *ac_ifp; /* network-visible interface */
- u_char _ac_enaddr[6]; /* ethernet hardware address */
+ u_char *_ac_enaddr; /* ethernet hardware address */
void *ac_netgraph; /* ng_ether(4) netgraph node info */
};
#define IFP2AC(ifp) ((struct arpcom *)(ifp->if_l2com))
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 9a8c41625930..9288a7fbeb07 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -846,7 +846,7 @@ ether_sprintf(const u_char *ap)
* Perform common duties while attaching to interface list
*/
void
-ether_ifattach(struct ifnet *ifp, const u_int8_t *llc)
+ether_ifattach(struct ifnet *ifp, const u_int8_t *lla)
{
int i;
struct ifaddr *ifa;
@@ -868,13 +868,8 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *llc)
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_ETHER;
sdl->sdl_alen = ifp->if_addrlen;
- bcopy(llc, LLADDR(sdl), ifp->if_addrlen);
- /*
- * XXX: This doesn't belong here; we do it until
- * XXX: all drivers are cleaned up
- */
- if (llc != IFP2ENADDR(ifp))
- bcopy(llc, IFP2ENADDR(ifp), ifp->if_addrlen);
+ bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
+ IFP2ENADDR(ifp) = LLADDR(sdl);
bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN);
if (ng_ether_attach_p != NULL)
@@ -882,10 +877,10 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *llc)
/* Announce Ethernet MAC address if non-zero. */
for (i = 0; i < ifp->if_addrlen; i++)
- if (llc[i] != 0)
+ if (lla[i] != 0)
break;
if (i != ifp->if_addrlen)
- if_printf(ifp, "Ethernet address: %6D\n", llc, ":");
+ if_printf(ifp, "Ethernet address: %6D\n", lla, ":");
if (debug_mpsafenet && (ifp->if_flags & IFF_NEEDSGIANT) != 0)
if_printf(ifp, "if_start running deferred for Giant\n");
}
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index ed33313c1f0e..917ed663e5cb 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -556,8 +556,9 @@ dropanyway:
* Perform common duties while attaching to interface list
*/
void
-fddi_ifattach(ifp, bpf)
+fddi_ifattach(ifp, lla, bpf)
struct ifnet *ifp;
+ const u_int8_t *lla;
int bpf;
{
struct ifaddr *ifa;
@@ -587,7 +588,8 @@ fddi_ifattach(ifp, bpf)
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_FDDI;
sdl->sdl_alen = ifp->if_addrlen;
- bcopy(IFP2ENADDR(ifp), LLADDR(sdl), ifp->if_addrlen);
+ bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
+ IFP2ENADDR(ifp) = LLADDR(sdl);
if (bpf)
bpfattach(ifp, DLT_FDDI, FDDI_HDR_LEN);
diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c
index 5e8382faea64..d78de122379e 100644
--- a/sys/net/if_iso88025subr.c
+++ b/sys/net/if_iso88025subr.c
@@ -91,7 +91,7 @@ static int iso88025_resolvemulti (struct ifnet *, struct sockaddr **,
* Perform common duties while attaching to interface list
*/
void
-iso88025_ifattach(struct ifnet *ifp, int bpf)
+iso88025_ifattach(struct ifnet *ifp, const u_int8_t *lla, int bpf)
{
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
@@ -123,7 +123,8 @@ iso88025_ifattach(struct ifnet *ifp, int bpf)
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
sdl->sdl_type = IFT_ISO88025;
sdl->sdl_alen = ifp->if_addrlen;
- bcopy(IFP2ENADDR(ifp), LLADDR(sdl), ifp->if_addrlen);
+ bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
+ IFP2ENADDR(ifp) = LLADDR(sdl);
if (bpf)
bpfattach(ifp, DLT_IEEE802, ISO88025_HDR_LEN);
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index b8b0703dcb4c..e0377e223aa4 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -663,9 +663,7 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
static int
vlan_config(struct ifvlan *ifv, struct ifnet *p)
{
- struct ifaddr *ifa1, *ifa2;
struct ifnet *ifp;
- struct sockaddr_dl *sdl1, *sdl2;
VLAN_LOCK_ASSERT();
@@ -741,14 +739,7 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p)
* Set up our ``Ethernet address'' to reflect the underlying
* physical interface's.
*/
- ifa1 = ifaddr_byindex(ifp->if_index);
- ifa2 = ifaddr_byindex(p->if_index);
- sdl1 = (struct sockaddr_dl *)ifa1->ifa_addr;
- sdl2 = (struct sockaddr_dl *)ifa2->ifa_addr;
- sdl1->sdl_type = IFT_ETHER;
- sdl1->sdl_alen = ETHER_ADDR_LEN;
- bcopy(LLADDR(sdl2), LLADDR(sdl1), ETHER_ADDR_LEN);
- bcopy(LLADDR(sdl2), IFP2ENADDR(ifp), ETHER_ADDR_LEN);
+ bcopy(IF_LLADDR(p), IF_LLADDR(ifp), ETHER_ADDR_LEN);
/*
* Configure multicast addresses that may already be
@@ -762,8 +753,6 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p)
static int
vlan_unconfig(struct ifnet *ifp)
{
- struct ifaddr *ifa;
- struct sockaddr_dl *sdl;
struct vlan_mc_entry *mc;
struct ifvlan *ifv;
struct ifnet *p;
@@ -812,12 +801,7 @@ vlan_unconfig(struct ifnet *ifp)
ifv->ifv_ifp->if_link_state = LINK_STATE_UNKNOWN;
/* Clear our MAC address. */
- ifa = ifaddr_byindex(ifv->ifv_ifp->if_index);
- sdl = (struct sockaddr_dl *)ifa->ifa_addr;
- sdl->sdl_type = IFT_ETHER;
- sdl->sdl_alen = ETHER_ADDR_LEN;
- bzero(LLADDR(sdl), ETHER_ADDR_LEN);
- bzero(IFP2ENADDR(ifv->ifv_ifp), ETHER_ADDR_LEN);
+ bzero(IF_LLADDR(ifv->ifv_ifp), ETHER_ADDR_LEN);
return (0);
}
diff --git a/sys/net/iso88025.h b/sys/net/iso88025.h
index 88d6d340c0fa..cb10874ebc11 100644
--- a/sys/net/iso88025.h
+++ b/sys/net/iso88025.h
@@ -162,7 +162,7 @@ struct iso88025_addr {
#define ISO88025_BPF_UNSUPPORTED 0
#define ISO88025_BPF_SUPPORTED 1
-void iso88025_ifattach (struct ifnet *, int);
+void iso88025_ifattach (struct ifnet *, const u_int8_t *, int);
void iso88025_ifdetach (struct ifnet *, int);
int iso88025_ioctl (struct ifnet *, int , caddr_t );
int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *,
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 3116108ab8f9..06b53b89728d 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -57,7 +57,7 @@
* is created, otherwise 1.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 700004 /* Master, propagated to newvers */
+#define __FreeBSD_version 700005 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>