Use M_WRITABLE() and M_LEADINGSPACE() rather than checking M_EXT and
doing hand-crafted length calculations in the IP options code. Reviewed by: bz Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
5c02a96905
commit
fb1ce16166
@ -500,7 +500,7 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen)
|
||||
}
|
||||
if (p->ipopt_dst.s_addr)
|
||||
ip->ip_dst = p->ipopt_dst;
|
||||
if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
|
||||
if (!M_WRITABLE(m) || M_LEADINGSPACE(m) < optlen) {
|
||||
n = m_gethdr(M_NOWAIT, MT_DATA);
|
||||
if (n == NULL) {
|
||||
*phlen = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user