diff options
| author | is <is@NetBSD.org> | 1999-05-04 14:58:27 +0000 |
|---|---|---|
| committer | is <is@NetBSD.org> | 1999-05-04 14:58:27 +0000 |
| commit | 7470bd006a620bbbb0db8fe65f2fbf79600ddb6f (patch) | |
| tree | 2b2c1808eef9fb600650333ba99054dedac3a729 | |
| parent | 38029cf240cf4218aeefd7316bafcc64d8e2879a (diff) | |
Fix for PR 7490 by Olaf Seibert, fix mostly from PR 7497 bei Zdenek Salvet,
but with more verbose error messages.
| -rw-r--r-- | sys/netinet/if_arp.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/netinet/if_arp.c b/sys/netinet/if_arp.c index 01832f761a3..c4c9b26fa28 100644 --- a/sys/netinet/if_arp.c +++ b/sys/netinet/if_arp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_arp.c,v 1.56 1999/03/22 22:30:42 bad Exp $ */ +/* $NetBSD: if_arp.c,v 1.57 1999/05/04 14:58:27 is Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -592,10 +592,22 @@ in_arpinput(m) la = arplookup(&isaddr, in_hosteq(itaddr, myaddr), 0); if (la && (rt = la->la_rt) && (sdl = SDL(rt->rt_gateway))) { if (sdl->sdl_alen && - bcmp((caddr_t)ar_sha(ah), LLADDR(sdl), sdl->sdl_alen)) - log(LOG_INFO, "arp info overwritten for %s by %s\n", - in_fmtaddr(isaddr), - lla_snprintf(ar_sha(ah), ah->ar_hln)); + bcmp((caddr_t)ar_sha(ah), LLADDR(sdl), sdl->sdl_alen)) { + if (rt->rt_ifp != ifp) { + log(LOG_INFO, + "%s on %s tried to overwrite " + "arp info for %s on %s\n", + lla_snprintf(ar_sha(ah), ah->ar_hln), + ifp->if_xname, in_fmtaddr(isaddr), + rt->rt_ifp->if_xname); + goto out; + } else { + log(LOG_INFO, + "arp info overwritten for %s by %s\n", + in_fmtaddr(isaddr), + lla_snprintf(ar_sha(ah), ah->ar_hln)); + } + } /* * sanity check for the address length. * XXX this does not work for protocols with variable address |
