summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-03-21 17:53:16 +0000
committermdodd <mdodd@FreeBSD.org>2003-03-21 17:53:16 +0000
commitcda1ad1e064fd4783b1518baa707b19bd947e746 (patch)
treec9d7c27b0ae3e258aa728bc72628c7cd24b17f63
parent2ead165b2523224693a1fe5664761073185728e2 (diff)
downloadFreeBSD-src-cda1ad1e064fd4783b1518baa707b19bd947e746.zip
FreeBSD-src-cda1ad1e064fd4783b1518baa707b19bd947e746.tar.gz
- Use if_broadcastaddr from struct ifnet rather than relying on
extern 'etherbroadcastaddr'. - Make 'etherbroadcastaddr' static. Reviewed by: imp
-rw-r--r--sys/dev/dc/if_dc.c4
-rw-r--r--sys/dev/de/if_de.c2
-rw-r--r--sys/dev/usb/if_cue.c2
-rw-r--r--sys/i386/isa/if_le.c2
-rw-r--r--sys/net/if_arp.h2
-rw-r--r--sys/net/if_ethersubr.c5
-rw-r--r--sys/netatalk/aarp.c8
-rw-r--r--sys/pci/if_dc.c4
-rw-r--r--sys/pci/if_de.c2
9 files changed, 16 insertions, 15 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index 1570ea4..1a73dc9 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -1176,7 +1176,7 @@ dc_setfilt_21143(sc)
}
if (ifp->if_flags & IFF_BROADCAST) {
- h = dc_crc_le(sc, (caddr_t)&etherbroadcastaddr);
+ h = dc_crc_le(sc, (caddr_t)ifp->if_broadcastaddr);
sp[h >> 4] |= 1 << (h & 0xF);
}
@@ -1372,7 +1372,7 @@ dc_setfilt_xircom(sc)
}
if (ifp->if_flags & IFF_BROADCAST) {
- h = dc_crc_le(sc, (caddr_t)&etherbroadcastaddr);
+ h = dc_crc_le(sc, (caddr_t)ifp->if_broadcastaddr);
sp[h >> 4] |= 1 << (h & 0xF);
}
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index d186586..44de080 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -3058,7 +3058,7 @@ tulip_addr_filter(
* receiving every multicast.
*/
if ((sc->tulip_flags & TULIP_ALLMULTI) == 0) {
- hash = tulip_mchash(etherbroadcastaddr);
+ hash = tulip_mchash(sc->tulip_if.if_broadcastaddr);
#if BYTE_ORDER == BIG_ENDIAN
sp[hash >> 4] |= bswap32(1 << (hash & 0xF));
#else
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index 8748a83..197d8be 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -376,7 +376,7 @@ cue_setmulti(struct cue_softc *sc)
* so we can receive broadcast frames.
*/
if (ifp->if_flags & IFF_BROADCAST) {
- h = cue_crc(etherbroadcastaddr);
+ h = cue_crc(ifp->if_broadcastaddr);
sc->cue_mctab[h >> 3] |= 1 << (h & 0x7);
}
diff --git a/sys/i386/isa/if_le.c b/sys/i386/isa/if_le.c
index 3ed6a96..5d4c5a4 100644
--- a/sys/i386/isa/if_le.c
+++ b/sys/i386/isa/if_le.c
@@ -537,7 +537,7 @@ le_multi_filter(
}
sc->le_flags &= ~IFF_MULTICAST;
/* if (interface has had an address assigned) { */
- le_multi_op(sc, etherbroadcastaddr, TRUE);
+ le_multi_op(sc, sc->le_if.if_broadcastaddr, TRUE);
sc->le_flags |= LE_BRDCSTONLY|IFF_MULTICAST;
/* } */
diff --git a/sys/net/if_arp.h b/sys/net/if_arp.h
index 227a7d2..1eb8cd8 100644
--- a/sys/net/if_arp.h
+++ b/sys/net/if_arp.h
@@ -114,8 +114,6 @@ struct arpcom {
int ac_multicnt; /* length of ac_multiaddrs list */
void *ac_netgraph; /* ng_ether(4) netgraph node info */
};
-
-extern u_char etherbroadcastaddr[6];
#endif
#endif /* !_NET_IF_ARP_H_ */
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index b3751a9..8dfb5fb 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -111,9 +111,12 @@ bdg_forward_t *bdg_forward_ptr;
bdgtakeifaces_t *bdgtakeifaces_ptr;
struct bdg_softc *ifp2sc;
+static u_char etherbroadcastaddr[ETHER_ADDR_LEN] =
+ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+
static int ether_resolvemulti(struct ifnet *, struct sockaddr **,
struct sockaddr *);
-u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+
#define senderr(e) do { error = (e); goto bad;} while (0)
#define IFP2AC(IFP) ((struct arpcom *)IFP)
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index f2598b9..b437097 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -180,7 +180,7 @@ aarpwhohas( struct arpcom *ac, struct sockaddr_at *sat )
ea->aarp_spnode = AA_SAT( aa )->sat_addr.s_node;
ea->aarp_tpnode = sat->sat_addr.s_node;
} else {
- bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
+ bcopy((caddr_t)ac->ac_if.if_broadcastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
eh->ether_type = htons( ETHERTYPE_AARP );
@@ -221,8 +221,8 @@ aarpresolve( ac, m, destsat, desten )
bcopy( (caddr_t)atmulticastaddr, (caddr_t)desten,
sizeof( atmulticastaddr ));
} else {
- bcopy( (caddr_t)etherbroadcastaddr, (caddr_t)desten,
- sizeof( etherbroadcastaddr ));
+ bcopy( (caddr_t)ac->ac_if.if_broadcastaddr, (caddr_t)desten,
+ sizeof( ac->ac_if.if_addrlen ));
}
return( 1 );
}
@@ -593,7 +593,7 @@ aarpprobe( void *arg )
sizeof( ea->aarp_tpnet ));
ea->aarp_spnode = ea->aarp_tpnode = AA_SAT( aa )->sat_addr.s_node;
} else {
- bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
+ bcopy((caddr_t)ac->ac_if.if_broadcastaddr, (caddr_t)eh->ether_dhost,
sizeof( eh->ether_dhost ));
eh->ether_type = htons( ETHERTYPE_AARP );
ea->aarp_spa = ea->aarp_tpa = AA_SAT( aa )->sat_addr.s_node;
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 1570ea4..1a73dc9 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -1176,7 +1176,7 @@ dc_setfilt_21143(sc)
}
if (ifp->if_flags & IFF_BROADCAST) {
- h = dc_crc_le(sc, (caddr_t)&etherbroadcastaddr);
+ h = dc_crc_le(sc, (caddr_t)ifp->if_broadcastaddr);
sp[h >> 4] |= 1 << (h & 0xF);
}
@@ -1372,7 +1372,7 @@ dc_setfilt_xircom(sc)
}
if (ifp->if_flags & IFF_BROADCAST) {
- h = dc_crc_le(sc, (caddr_t)&etherbroadcastaddr);
+ h = dc_crc_le(sc, (caddr_t)ifp->if_broadcastaddr);
sp[h >> 4] |= 1 << (h & 0xF);
}
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index d186586..44de080 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -3058,7 +3058,7 @@ tulip_addr_filter(
* receiving every multicast.
*/
if ((sc->tulip_flags & TULIP_ALLMULTI) == 0) {
- hash = tulip_mchash(etherbroadcastaddr);
+ hash = tulip_mchash(sc->tulip_if.if_broadcastaddr);
#if BYTE_ORDER == BIG_ENDIAN
sp[hash >> 4] |= bswap32(1 << (hash & 0xF));
#else
OpenPOWER on IntegriCloud