Correctly move the packet header in ip_insertoptions().

Reported by: Anupam Chanda
Reviewed by: sam@
MFC after: 2 weeks
This commit is contained in:
Alan Cox 2005-01-23 19:43:46 +00:00
parent 641a1aa10d
commit 7258e9687b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140675

View file

@ -1064,11 +1064,12 @@ ip_insertoptions(m, opt, phlen)
*phlen = 0;
return (m);
}
M_MOVE_PKTHDR(n, m);
n->m_pkthdr.rcvif = (struct ifnet *)0;
#ifdef MAC
mac_create_mbuf_from_mbuf(m, n);
#endif
n->m_pkthdr.len = m->m_pkthdr.len + optlen;
n->m_pkthdr.len += optlen;
m->m_len -= sizeof(struct ip);
m->m_data += sizeof(struct ip);
n->m_next = m;