View | Details | Raw Unified | Return to bug 222746 | Differences between
and this patch

Collapse All | Expand All

(-)head/sys/netpfil/ipfw/ip_fw2.c (-1 / +10 lines)
Lines 1768-1778 Link Here
1768
			case O_TCPDATALEN:
1768
			case O_TCPDATALEN:
1769
				if (proto == IPPROTO_TCP && offset == 0) {
1769
				if (proto == IPPROTO_TCP && offset == 0) {
1770
				    struct tcphdr *tcp;
1770
				    struct tcphdr *tcp;
1771
				    uint16_t x;
1771
				    uint16_t x = 0;
1772
				    uint16_t *p;
1772
				    uint16_t *p;
1773
				    int i;
1773
				    int i;
1774
1774
1775
				    tcp = TCP(ulp);
1775
				    tcp = TCP(ulp);
1776
#ifdef INET6
1777
				    if (is_ipv6) {
1778
					struct ip6_hdr *ip6 = (struct ip6_hdr *)ip;
1779
					u_int b = hlen - sizeof(struct ip6_hdr) + (tcp->th_off << 2);
1780
					uint16_t e = ntohs(ip6->ip6_plen);
1781
					if (b <= e) /* implies b <= UINT16_MAX */
1782
					    x = e - (uint16_t)b;
1783
				    } else /* if (is_ipv4) */
1784
#endif /* INET6 */
1776
				    x = iplen -
1785
				    x = iplen -
1777
					((ip->ip_hl + tcp->th_off) << 2);
1786
					((ip->ip_hl + tcp->th_off) << 2);
1778
				    if (cmdlen == 1) {
1787
				    if (cmdlen == 1) {

Return to bug 222746