summaryrefslogtreecommitdiffstats
path: root/sys/netinet/if_ether.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2015-10-07 13:10:26 +0000
committerglebius <glebius@FreeBSD.org>2015-10-07 13:10:26 +0000
commit46f350c8acc7a6f36781e7ad78b3516bd63976cb (patch)
treef24946b464172e9392aca5f26066d000b92ab7dc /sys/netinet/if_ether.c
parentdaa604f29470fbd4f5eac28fbe136749017b98ab (diff)
downloadFreeBSD-src-46f350c8acc7a6f36781e7ad78b3516bd63976cb.zip
FreeBSD-src-46f350c8acc7a6f36781e7ad78b3516bd63976cb.tar.gz
Fix regression from r287779, that bite me. If we call m_pullup()
unconditionally, we end up with an mbuf chain of two mbufs, which later in in_arpreply() is rewritten from ARP request to ARP reply and is sent out. Looks like igb(4) (at least mine, and at least at my network) fails on such mbuf chain, so ARP reply doesn't go out wire. Thus, make the m_pullup() call conditional, as it is everywhere. Of course, the bug in igb(?) should be investigated, but better first fix the head. And unconditional m_pullup() was suboptimal, anyway.
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r--sys/netinet/if_ether.c13
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 = "";
OpenPOWER on IntegriCloud