mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
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
57c5139c46
commit
e1165035a6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276752
@ -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