diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index ad07473..aa616eb 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -531,12 +531,15 @@ arpintr(struct mbuf *m) ar = mtod(m, struct arphdr *); /* Check if length is sufficient */ - if ((m = m_pullup(m, arphdr_len(ar))) == NULL) { - ARP_LOG(LOG_NOTICE, "short packet received on %s\n", - if_name(ifp)); - return; + if (m->m_len < arphdr_len(ar)) { + m = m_pullup(m, arphdr_len(ar)); + if (m == NULL) { + ARP_LOG(LOG_NOTICE, "short packet received on %s\n", + if_name(ifp)); + return; + } + ar = mtod(m, struct arphdr *); } - ar = mtod(m, struct arphdr *); hlen = 0; layer = ""; |