FreeBSD Bugzilla – Attachment 187283 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]
Proposed patch for tcplen
tcplen.diff (text/plain), 1.94 KB, created by
Andrey V. Elsukov
on 2017-10-18 15:09:36 UTC
(
hide
)
Description:
Proposed patch for tcplen
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2017-10-18 15:09:36 UTC
Size:
1.94 KB
patch
obsolete
>diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c >index 0bffee6d6e3..1469d5d8417 100644 >--- a/sys/netpfil/ipfw/ip_fw2.c >+++ b/sys/netpfil/ipfw/ip_fw2.c >@@ -1115,7 +1115,7 @@ ipfw_chk(struct ip_fw_args *args) > uint8_t proto; > uint16_t src_port = 0, dst_port = 0; /* NOTE: host format */ > struct in_addr src_ip, dst_ip; /* NOTE: network format */ >- uint16_t iplen=0; >+ int iplen = 0; > int pktlen; > uint16_t etype = 0; /* Host order stored ether type */ > >@@ -1357,6 +1357,7 @@ do { \ > args->f_id.src_ip = 0; > args->f_id.dst_ip = 0; > args->f_id.flow_id6 = ntohl(ip6->ip6_flow); >+ iplen = ntohs(ip6->ip6_plen) + sizeof(*ip6); > } else if (pktlen >= sizeof(struct ip) && > (args->eh == NULL || etype == ETHERTYPE_IP) && ip->ip_v == 4) { > is_ipv4 = 1; >@@ -1371,7 +1372,6 @@ do { \ > dst_ip = ip->ip_dst; > offset = ntohs(ip->ip_off) & IP_OFFMASK; > iplen = ntohs(ip->ip_len); >- pktlen = iplen < pktlen ? iplen : pktlen; > > if (offset == 0) { > switch (proto) { >@@ -1410,6 +1410,7 @@ do { \ > args->f_id.dst_ip = ntohl(dst_ip.s_addr); > } > #undef PULLUP_TO >+ pktlen = iplen < pktlen ? iplen: pktlen; > if (proto) { /* we may have port numbers, store them */ > args->f_id.proto = proto; > args->f_id.src_port = src_port = ntohs(src_port); >@@ -1930,10 +1931,25 @@ do { \ > uint16_t x; > uint16_t *p; > int i; >- >+#ifdef INET6 >+ if (is_ipv6) { >+ struct ip6_hdr *ip6; >+ >+ ip6 = (struct ip6_hdr *)ip; >+ if (ip6->ip6_plen == 0) { >+ /* >+ * Jumbo payload is not >+ * supported by this >+ * opcode. >+ */ >+ break; >+ } >+ x = iplen - hlen; >+ } else >+#endif /* INET6 */ >+ x = iplen - (ip->ip_hl << 2); > tcp = TCP(ulp); >- x = iplen - >- ((ip->ip_hl + tcp->th_off) << 2); >+ x -= tcp->th_off << 2; > if (cmdlen == 1) { > match = (cmd->arg1 == x); > break;
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