Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110719196
D40911.id124282.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40911.id124282.diff
View Options
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -112,9 +112,8 @@
#include <netinet6/scope6_var.h>
#endif /* INET6 */
-#if defined(SCTP) || defined(SCTP_SUPPORT)
+#include <netinet/sctp_header.h>
#include <netinet/sctp_crc32.h>
-#endif
#include <machine/in_cksum.h>
#include <security/mac/mac_framework.h>
@@ -441,6 +440,21 @@
VNET_DEFINE(uint32_t, pf_hashseed);
#define V_pf_hashseed VNET(pf_hashseed)
+static void
+pf_sctp_checksum(struct mbuf *m, int off)
+{
+ uint32_t sum = 0;
+
+ /* Zero out the checksum, to enable recalculation. */
+ m_copyback(m, off + offsetof(struct sctphdr, checksum),
+ sizeof(sum), (caddr_t)&sum);
+
+ sum = sctp_calculate_cksum(m, off);
+
+ m_copyback(m, off + offsetof(struct sctphdr, checksum),
+ sizeof(sum), (caddr_t)&sum);
+}
+
int
pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af)
{
@@ -6570,12 +6584,10 @@
in_delayed_cksum(m0);
m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
-#if defined(SCTP) || defined(SCTP_SUPPORT)
if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) {
- sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2));
+ pf_sctp_checksum(m0, (uint32_t)(ip->ip_hl << 2));
m0->m_pkthdr.csum_flags &= ~CSUM_SCTP;
}
-#endif
/*
* If small enough for interface, or the interface will take
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 23, 7:28 AM (6 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16790395
Default Alt Text
D40911.id124282.diff (1 KB)
Attached To
Mode
D40911: pf: use sctp_calculate_cksum()
Attached
Detach File
Event Timeline
Log In to Comment