diff options
author | rwatson <rwatson@FreeBSD.org> | 2015-01-06 14:32:28 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2015-01-06 14:32:28 +0000 |
commit | fb1ce161667f12c7ba649bbcf23a945874398891 (patch) | |
tree | 99d001f6bcaa4b7bc60d6d09a747628189b54ac6 /sys | |
parent | 5c02a969057b454dfd5431d8e628a9162f51ce80 (diff) | |
download | FreeBSD-src-fb1ce161667f12c7ba649bbcf23a945874398891.zip FreeBSD-src-fb1ce161667f12c7ba649bbcf23a945874398891.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_options.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c index cdb98be..17ad423 100644 --- a/sys/netinet/ip_options.c +++ b/sys/netinet/ip_options.c @@ -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; |