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:
Ruslan Ermilov 2003-12-23 13:33:23 +00:00
parent dbe0253a8b
commit 78e2d2bd28

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