From mboxrd@z Thu Jan 1 00:00:00 1970 From: Morgon.J.Kanter@Dartmouth.edu Subject: Re: Recalculate checksums in netfilter queue Date: Thu, 22 Apr 2010 08:43:13 -0400 Message-ID: <20100422084313.jk0ntlfyss444g0o@webmail.dartmouth.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Transfer-Encoding: 7bit Cc: netfilter-devel@vger.kernel.org To: Justin Yaple Return-path: Received: from spruis.dartmouth.edu ([129.170.208.37]:39786 "EHLO spruis.dartmouth.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754639Ab0DVM7n (ORCPT ); Thu, 22 Apr 2010 08:59:43 -0400 In-Reply-To: Content-Disposition: inline Sender: netfilter-devel-owner@vger.kernel.org List-ID: My understanding is that the one complement of each 16-bit word is > summed, and then the result of that is bitwise complemented. > > So for each word we would do something like this. > for each word{ > sum += ~word; > } > > then you would take the bitwise complement of that total. > sum = ~sum; The RFC for IP contains C code that you can literally copy and paste for this task. -- Morgon