diff options
author | ru <ru@FreeBSD.org> | 2003-12-23 13:33:23 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2003-12-23 13:33:23 +0000 |
commit | 0b3fdbfa5200ef73e1c802d77fff9038a710bad1 (patch) | |
tree | c8c03633a2e7a49512ff5830a711e95d5befd9c3 /sys/netinet | |
parent | abd1027a01880a215e2c2f5c955c21a22e7424bd (diff) | |
download | FreeBSD-src-0b3fdbfa5200ef73e1c802d77fff9038a710bad1.zip FreeBSD-src-0b3fdbfa5200ef73e1c802d77fff9038a710bad1.tar.gz |
Fix a problem introduced in revision 1.84: m_pullup() does not
necessarily return the same mbuf chain so we need to recompute
mtod() consumers after pulling up.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index c5238cf..34f820d 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -530,11 +530,13 @@ arpintr(struct mbuf *m) return; } - if (m->m_pkthdr.len < arphdr_len(ar) && - (m = m_pullup(m, arphdr_len(ar))) == NULL) { - log(LOG_ERR, "arp: runt packet\n"); - m_freem(m); - return; + if (m->m_pkthdr.len < arphdr_len(ar)) { + if ((m = m_pullup(m, arphdr_len(ar))) == NULL) { + log(LOG_ERR, "arp: runt packet\n"); + m_freem(m); + return; + } + ar = mtod(m, struct arphdr *); } switch (ntohs(ar->ar_pro)) { |