From owner-freebsd-net@FreeBSD.ORG Fri May 26 21:30:42 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAE9B16BB0C for ; Fri, 26 May 2006 21:30:42 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E1F343D72 for ; Fri, 26 May 2006 21:30:42 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.23.205]) ([10.251.23.205]) by a50.ironport.com with ESMTP; 26 May 2006 14:30:42 -0700 Message-ID: <44777382.9070602@elischer.org> Date: Fri, 26 May 2006 14:30:42 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amit Mondal References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: TCP checksum X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 May 2006 21:30:48 -0000 Amit Mondal wrote: > Hi, > > Could anyone pls tell me the function freebsd provides for calculating > TCP > checksum. > > What I am doing, I am sniffing packet using divert packet and changing > the > destination address of the packet. Now, since TCP checksum calculation > include Pseudo head (src dest IP ....) I need to recalculate TCP > checksum. > Is there any way to recalculate the checksum incrementally. look at libalias. (also check the port for the divert based daemon that does the mss fixup. I forget what it is called) if you change a few bytes in the packet you can change the checksum appropriatly without recalculating the whole thing. You should be able to find lots of examples from google, and I'm pretty sure libalias does it.. > > Thanks in advance. > > Rgds > -Amit > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"