diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-02-07 04:01:12 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-02-07 04:01:12 +0000 |
commit | 5f0e5dd19ecc24709b394c91848b8ddd67c8a2f8 (patch) | |
tree | 1df4093b4413268336271dc1b4c70ddd98cf8822 | |
parent | 27590ec49c273af0bce2de7019967ad5ed83b133 (diff) |
Print a different error message if the route entry supposed to contain
ARP information is of a different kind.
ok sthen@, claudio@
-rw-r--r-- | sys/netinet/if_ether.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index a73af42bbdc..69290aaf997 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.144 2015/02/05 03:01:03 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.145 2015/02/07 04:01:11 mpi Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -370,6 +370,15 @@ arpresolve(struct arpcom *ac, struct rtentry *rt0, struct mbuf *m, return (error); } + if ((rt->rt_flags & RTF_LLINFO) == 0) { + log(LOG_DEBUG, "arpresolve: %s: route contains no arp" + " information\n", inet_ntop(AF_INET, + &satosin(rt_key(rt))->sin_addr, addr, + sizeof(addr))); + m_freem(m); + return (EINVAL); + } + la = (struct llinfo_arp *)rt->rt_llinfo; if (la == NULL) log(LOG_DEBUG, "arpresolve: %s: route without link " |