Reimplement a test for broadcast addresses advertized, which was left out

when rewriting the ARP system.
This commit is contained in:
is 1997-10-02 19:41:56 +00:00
parent 284a78edc2
commit fabb33431c
6 changed files with 20 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.c,v 1.41 1997/08/29 00:57:54 thorpej Exp $ */ /* $NetBSD: if.c,v 1.42 1997/10/02 19:41:56 is Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -132,6 +132,7 @@ if_attach(ifp)
sdl->sdl_data[--namelen] = 0xff; sdl->sdl_data[--namelen] = 0xff;
if (ifp->if_snd.ifq_maxlen == 0) if (ifp->if_snd.ifq_maxlen == 0)
ifp->if_snd.ifq_maxlen = ifqmaxlen; ifp->if_snd.ifq_maxlen = ifqmaxlen;
ifp->if_broadcastaddr = 0; /* reliably crash if used uninitialized */
} }
/* /*
* Locate an interface based on a complete address. * Locate an interface based on a complete address.

View File

@ -1,4 +1,4 @@
/* $NetBSD: if.h,v 1.28 1997/04/08 21:29:26 chuck Exp $ */ /* $NetBSD: if.h,v 1.29 1997/10/02 19:41:57 is Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1989, 1993 * Copyright (c) 1982, 1986, 1989, 1993
@ -145,6 +145,7 @@ struct ifnet { /* and the entries */
int ifq_drops; int ifq_drops;
} if_snd; /* output queue */ } if_snd; /* output queue */
struct sockaddr_dl *if_sadl; /* pointer to our sockaddr_dl */ struct sockaddr_dl *if_sadl; /* pointer to our sockaddr_dl */
u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */
}; };
#define if_mtu if_data.ifi_mtu #define if_mtu if_data.ifi_mtu
#define if_type if_data.ifi_type #define if_type if_data.ifi_type

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_arcsubr.c,v 1.15 1997/03/23 01:22:35 is Exp $ */ /* $NetBSD: if_arcsubr.c,v 1.16 1997/10/02 19:41:58 is Exp $ */
/* /*
* Copyright (c) 1994, 1995 Ignatios Souvatzis * Copyright (c) 1994, 1995 Ignatios Souvatzis
@ -648,4 +648,5 @@ arc_ifattach(ifp, lla)
sdl->sdl_alen = ifp->if_addrlen; sdl->sdl_alen = ifp->if_addrlen;
bcopy((caddr_t)&lla, LLADDR(sdl), ifp->if_addrlen); bcopy((caddr_t)&lla, LLADDR(sdl), ifp->if_addrlen);
} }
ifp->if_broadcastaddr = &arcbroadcastaddr;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ethersubr.c,v 1.25 1997/04/03 18:48:28 christos Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.26 1997/10/02 19:41:59 is Exp $ */
/* /*
* Copyright (c) 1982, 1989, 1993 * Copyright (c) 1982, 1989, 1993
@ -648,6 +648,7 @@ ether_ifattach(ifp, lla)
bcopy((caddr_t)lla, LLADDR(sdl), ifp->if_addrlen); bcopy((caddr_t)lla, LLADDR(sdl), ifp->if_addrlen);
} }
LIST_INIT(&((struct ethercom *)ifp)->ec_multiaddrs); LIST_INIT(&((struct ethercom *)ifp)->ec_multiaddrs);
ifp->if_broadcastaddr = etherbroadcastaddr;
} }
u_char ether_ipmulticast_min[6] = { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 }; u_char ether_ipmulticast_min[6] = { 0x01, 0x00, 0x5e, 0x00, 0x00, 0x00 };

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_fddisubr.c,v 1.14 1997/04/03 21:07:42 christos Exp $ */ /* $NetBSD: if_fddisubr.c,v 1.15 1997/10/02 19:42:00 is Exp $ */
/* /*
* Copyright (c) 1995, 1996 * Copyright (c) 1995, 1996
@ -772,6 +772,7 @@ fddi_ifattach(ifp)
sdl->sdl_alen = ifp->if_addrlen; sdl->sdl_alen = ifp->if_addrlen;
bcopy(lla, LLADDR(sdl), ifp->if_addrlen); bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
} }
ifp->if_broadcastaddr = fddibroadcastaddr;
#else #else
for (ifa = ifp->if_addrlist; ifa != NULL; ifa = ifa->ifa_next) for (ifa = ifp->if_addrlist; ifa != NULL; ifa = ifa->ifa_next)
if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) && if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_arp.c,v 1.40 1997/08/29 16:02:41 gwr Exp $ */ /* $NetBSD: if_arp.c,v 1.41 1997/10/02 19:42:02 is Exp $ */
/* /*
* Copyright (c) 1982, 1986, 1988, 1993 * Copyright (c) 1982, 1986, 1988, 1993
@ -506,16 +506,15 @@ in_arpinput(m)
if (!bcmp((caddr_t)ar_sha(ah), LLADDR(ifp->if_sadl), if (!bcmp((caddr_t)ar_sha(ah), LLADDR(ifp->if_sadl),
ifp->if_data.ifi_addrlen)) ifp->if_data.ifi_addrlen))
goto out; /* it's from me, ignore it. */ goto out; /* it's from me, ignore it. */
/*
* XXX if (!bcmp((caddr_t)ar_sha(ah), (caddr_t)ifp->if_broadcastaddr,
* if (!bcmp((caddr_t)ar_sha(ah), (caddr_t)etherbroadcastaddr, ifp->if_data.ifi_addrlen)) {
* sizeof (ea->arp_sha))) { log(LOG_ERR,
* log(LOG_ERR, "%s: arp: link address is broadcast for IP address %x!\n",
* "arp: ether address is broadcast for IP address %x!\n", ifp->if_xname, ntohl(isaddr.s_addr));
* ntohl(isaddr.s_addr)); goto out;
* goto out; }
* }
*/
if (in_hosteq(isaddr, myaddr)) { if (in_hosteq(isaddr, myaddr)) {
log(LOG_ERR, log(LOG_ERR,
"duplicate IP address %08x sent from link address %s\n", "duplicate IP address %08x sent from link address %s\n",