FreeBSD Bugzilla – Attachment 186915 Details for
Bug 222746
ipfw: tcpdatalen does not exactly match IPv6 packets.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for CURRENT
patch-ip_fw2.c_2.diff (text/plain), 864 bytes, created by
Tatsuki Makino
on 2017-10-05 04:42:19 UTC
(
hide
)
Description:
patch for CURRENT
Filename:
MIME Type:
Creator:
Tatsuki Makino
Created:
2017-10-05 04:42:19 UTC
Size:
864 bytes
patch
obsolete
>Index: head/sys/netpfil/ipfw/ip_fw2.c >=================================================================== >--- head/sys/netpfil/ipfw/ip_fw2.c (revision 324216) >+++ head/sys/netpfil/ipfw/ip_fw2.c (working copy) >@@ -1768,11 +1768,20 @@ > case O_TCPDATALEN: > if (proto == IPPROTO_TCP && offset == 0) { > struct tcphdr *tcp; >- uint16_t x; >+ uint16_t x = 0; > uint16_t *p; > int i; > > tcp = TCP(ulp); >+#ifdef INET6 >+ if (is_ipv6) { >+ struct ip6_hdr *ip6 = (struct ip6_hdr *)ip; >+ u_int b = hlen - sizeof(struct ip6_hdr) + (tcp->th_off << 2); >+ uint16_t e = ntohs(ip6->ip6_plen); >+ if (b <= e) /* implies b <= UINT16_MAX */ >+ x = e - (uint16_t)b; >+ } else /* if (is_ipv4) */ >+#endif /* INET6 */ > x = iplen - > ((ip->ip_hl + tcp->th_off) << 2); > if (cmdlen == 1) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222746
:
186874
|
186894
|
186915
|
187283