diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-09-24 21:11:35 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-09-24 21:11:35 +0000 |
commit | d5874c6c876d2feff011c4fbf8ce6c43c1679019 (patch) | |
tree | f4a42ff6e134de0ceb258c6ef21a63a2af187df6 /sys | |
parent | 76babf87a3062e78fa213f8870a403b3da878020 (diff) |
on-link DoS by bogus ARP. reported by apple
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/if_ether.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index c9689f05b8f..a2f1fd99566 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.48 2003/06/02 23:28:13 millert Exp $ */ +/* $OpenBSD: if_ether.c,v 1.49 2003/09/24 21:11:34 itojun Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -740,10 +740,18 @@ arplookup(addr, create, proxy) rt->rt_refcnt--; if ((rt->rt_flags & RTF_GATEWAY) || (rt->rt_flags & RTF_LLINFO) == 0 || rt->rt_gateway->sa_family != AF_LINK) { - if (create) + if (create) { log(LOG_DEBUG, "arplookup: unable to enter address for %s\n", inet_ntoa(sin.sin_addr)); + if (rt->rt_refcnt <= 0 && + (rt->rt_flags & RTF_CLONED) != 0) { + rtrequest(RTM_DELETE, + (struct sockaddr *)rt_key(rt), + rt->rt_gateway, rt_mask(rt), rt->rt_flags, + 0); + } + } return (0); } return ((struct llinfo_arp *)rt->rt_llinfo); |