diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-13 13:45:58 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-13 13:45:58 -0300 |
commit | e52aa5f667faebee85874ec39c29fa1257dd554f (patch) | |
tree | b08cff1a8d0fb8f667942aca5b9a8be9fb5dca03 /sys/contrib | |
parent | 945ed01c4bae06169f63978e43029c04d4abd731 (diff) | |
parent | 8096b85f202b18e1be6a5dd5251a10fcdb255a78 (diff) | |
download | FreeBSD-src-e52aa5f667faebee85874ec39c29fa1257dd554f.zip FreeBSD-src-e52aa5f667faebee85874ec39c29fa1257dd554f.tar.gz |
Merge branch 'stable/10' into devel
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index 325ddce..f10699d 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -1134,6 +1134,22 @@ ipf_checkv4sum(fin) return -1; } if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + /* Depending on the driver, UDP may have zero checksum */ + if (fin->fin_p == IPPROTO_UDP && (fin->fin_flx & + (FI_FRAG|FI_SHORT|FI_BAD)) == 0) { + udphdr_t *udp = fin->fin_dp; + if (udp->uh_sum == 0) { + /* + * we're good no matter what the hardware + * checksum flags and csum_data say (handling + * of csum_data for zero UDP checksum is not + * consistent across all drivers) + */ + fin->fin_cksum = 1; + return 0; + } + } + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) sum = m->m_pkthdr.csum_data; else |