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.
This commit is contained in:
ru 2003-12-23 13:33:23 +00:00
parent abd1027a01
commit 0b3fdbfa52

View File

@ -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)) {