Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2012 18:15:01 +0000 (UTC)
From:      Max Khon <fjoe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241002 - head/sys/contrib/ipfilter/netinet
Message-ID:  <201209271815.q8RIF2vT070051@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fjoe
Date: Thu Sep 27 18:15:01 2012
New Revision: 241002
URL: http://svn.freebsd.org/changeset/base/241002

Log:
  Fix pseudo checksum calculation.
  
  This fixes ipfilter w/ network controllers that implement only
  partial rx csum offloading.
  
  PR:			106438
  Obtained from:		upstream
  MFC after:		1 week

Modified:
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c

Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Thu Sep 27 17:48:04 2012	(r241001)
+++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Thu Sep 27 18:15:01 2012	(r241002)
@@ -1357,7 +1357,9 @@ fr_info_t *fin;
 		else
 			sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
 					htonl(m->m_pkthdr.csum_data +
-					fin->fin_ip->ip_len + fin->fin_p));
+					fin->fin_ip->ip_len -
+					(fin->fin_ip->ip_hl << 2) +
+					fin->fin_p));
 		sum ^= 0xffff;
 		if (sum != 0) {
 			fin->fin_flx |= FI_BAD;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209271815.q8RIF2vT070051>