FreeBSD Bugzilla – Attachment 165123 Details for
Bug 198868
pf brakes tcp checksum if enabled for ue adapter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Test-patch
pf_fxp_csum.patch (text/plain), 1.90 KB, created by
Kristof Provost
on 2016-01-05 21:18:45 UTC
(
hide
)
Description:
Test-patch
Filename:
MIME Type:
Creator:
Kristof Provost
Created:
2016-01-05 21:18:45 UTC
Size:
1.90 KB
patch
obsolete
>diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c >index 57e78e8..a91a6ff 100644 >--- a/sys/netpfil/pf/pf.c >+++ b/sys/netpfil/pf/pf.c >@@ -5623,6 +5623,8 @@ bad: > * network driver performed cksum, needs to additional pseudo header > * cksum computation with partial csum_data(i.e. lack of H/W support for > * pseudo header, for instance hme(4), sk(4) and possibly gem(4)) >+ * Because this is such a rare situation don't bother handling it separately. >+ * Just recalculate the checksum from scratch. > * > * After validating the cksum of packet, set both flag CSUM_DATA_VALID and > * CSUM_PSEUDO_HDR in order to avoid recomputation of the cksum in upper >@@ -5634,7 +5636,6 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a > { > u_int16_t sum = 0; > int hw_assist = 0; >- struct ip *ip; > > if (off < sizeof(struct ip) || len < sizeof(struct udphdr)) > return (1); >@@ -5643,29 +5644,10 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a > > switch (p) { > case IPPROTO_TCP: >- if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { >- if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) { >- sum = m->m_pkthdr.csum_data; >- } else { >- ip = mtod(m, struct ip *); >- sum = in_pseudo(ip->ip_src.s_addr, >- ip->ip_dst.s_addr, htonl((u_short)len + >- m->m_pkthdr.csum_data + IPPROTO_TCP)); >- } >- sum ^= 0xffff; >- ++hw_assist; >- } >- break; > case IPPROTO_UDP: >- if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { >- if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) { >- sum = m->m_pkthdr.csum_data; >- } else { >- ip = mtod(m, struct ip *); >- sum = in_pseudo(ip->ip_src.s_addr, >- ip->ip_dst.s_addr, htonl((u_short)len + >- m->m_pkthdr.csum_data + IPPROTO_UDP)); >- } >+ if ((m->m_pkthdr.csum_flags & (CSUM_DATA_VALID | >+ CSUM_PSEUDO_HDR)) == (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) { >+ sum = m->m_pkthdr.csum_data; > sum ^= 0xffff; > ++hw_assist; > }
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 198868
: 165123