diff options
author | Garrett Wollman <wollman@FreeBSD.org> | 1996-02-05 18:04:30 +0000 |
---|---|---|
committer | Garrett Wollman <wollman@FreeBSD.org> | 1996-02-05 18:04:30 +0000 |
commit | cbb0b46ab740296fe6b257b4372625a742d4bec4 (patch) | |
tree | 4cb250dfb18276e8dc0f58c9b4377961ef94de72 /sys/netinet/if_ether.c | |
parent | abc8ea162c7298ab3d6e01c58a575098b5750325 (diff) | |
download | src-cbb0b46ab740296fe6b257b4372625a742d4bec4.tar.gz src-cbb0b46ab740296fe6b257b4372625a742d4bec4.zip |
Fill in the corresponding ether address of multicast and broadcast
pseudo-``ARP entries'' so arp(8) doesn't show them as `unresolved'.
Notes
Notes:
svn path=/head/; revision=13926
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r-- | sys/netinet/if_ether.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 44b5e017d685..115c2a3a5fe2 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.25 1995/12/20 21:53:51 wollman Exp $ + * $Id: if_ether.c,v 1.26 1996/01/24 21:09:58 phk Exp $ */ /* @@ -209,6 +209,22 @@ arp_rtrequest(req, rt, sa) la->la_rt = rt; rt->rt_flags |= RTF_LLINFO; LIST_INSERT_HEAD(&llinfo_arp, la, la_le); + + /* + * This keeps the multicast addresses from showing up + * in `arp -a' listings as unresolved. It's not actually + * functional. Then the same for broadcast. + */ + if (IN_MULTICAST(ntohl(SIN(rt_key(rt))->sin_addr.s_addr))) { + ETHER_MAP_IP_MULTICAST(&SIN(rt_key(rt))->sin_addr, + LLADDR(SDL(gate))); + SDL(gate)->sdl_alen = 6; + } + if (in_broadcast(SIN(rt_key(rt))->sin_addr, rt->rt_ifp)) { + memcpy(LLADDR(SDL(gate)), etherbroadcastaddr, 6); + SDL(gate)->sdl_alen = 6; + } + if (SIN(rt_key(rt))->sin_addr.s_addr == (IA_SIN(rt->rt_ifa))->sin_addr.s_addr) { /* |