m_pulldown() may reallocate n. Update the oip pointer after the

m_pulldown() call.

MFC after:	2 weeks
Sponsored by:	Netflix
This commit is contained in:
Jonathan T. Looney 2018-11-02 19:14:15 +00:00
parent e74f411d47
commit 54e675342b

View file

@ -264,6 +264,7 @@ icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu)
if (n->m_len < oiphlen + tcphlen &&
(n = m_pullup(n, oiphlen + tcphlen)) == NULL)
goto freeit;
oip = mtod(n, struct ip *);
icmpelen = max(tcphlen, min(V_icmp_quotelen,
ntohs(oip->ip_len) - oiphlen));
} else if (oip->ip_p == IPPROTO_SCTP) {