Date: Tue, 13 Oct 2015 04:23:22 +0000 (UTC) From: Cy Schubert <cy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289211 - stable/9/sys/contrib/ipfilter/netinet Message-ID: <201510130423.t9D4NMWx067231@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cy Date: Tue Oct 13 04:23:21 2015 New Revision: 289211 URL: https://svnweb.freebsd.org/changeset/base/289211 Log: MFC r288910: On some interfaces, ipfilter drops UDP packets with zero checkum. This commit fixes that. PR: 166372 Submitted by: mk@neon1.net Reviewed by: Darren Reed <darrenr@reed.wattle.id.au> Modified: stable/9/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/9/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Tue Oct 13 04:19:49 2015 (r289210) +++ stable/9/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Tue Oct 13 04:23:21 2015 (r289211) @@ -1361,6 +1361,22 @@ fr_info_t *fin; ip = fin->fin_ip; 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; + } + } + if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) sum = m->m_pkthdr.csum_data; else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510130423.t9D4NMWx067231>