From owner-freebsd-net@FreeBSD.ORG Tue Apr 27 14:16:41 2004 Return-Path: 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 A056916A4CF; Tue, 27 Apr 2004 14:16:41 -0700 (PDT) Received: from postman.ripe.net (postman.ripe.net [193.0.0.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B3F443D53; Tue, 27 Apr 2004 14:16:41 -0700 (PDT) (envelope-from marks@dell-laptop.6bone.nl) Received: by postman.ripe.net (Postfix, from userid 8) id 5896C4E68A; Tue, 27 Apr 2004 23:16:40 +0200 (CEST) Received: from birch.ripe.net (birch.ripe.net [193.0.1.96]) by postman.ripe.net (Postfix) with ESMTP id D30E04E6DB; Tue, 27 Apr 2004 23:16:39 +0200 (CEST) Received: from dell-laptop.6bone.nl (cow.ripe.net [193.0.1.239]) by birch.ripe.net (8.12.10/8.11.6) with SMTP id i3RLGdVt023128; Tue, 27 Apr 2004 23:16:39 +0200 Received: (nullmailer pid 5170 invoked by uid 1001); Tue, 27 Apr 2004 21:16:39 -0000 Date: Tue, 27 Apr 2004 23:16:39 +0200 From: Mark Santcroos To: Ruslan Ermilov Message-ID: <20040427211639.GA1455@laptop.6bone.nl> References: <20040427160901.GA2552@laptop.6bone.nl> <20040427190543.GA75827@ip.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040427190543.GA75827@ip.net.ua> User-Agent: Mutt/1.4.2.1i X-Handles: MS6-6BONE, MS18417-RIPE X-RIPE-Spam-Level: X-RIPE-Spam-Status: N 0.000023 / 0.0 / 0.0 / disabled X-RIPE-Signature: 850013f1fdfc77f9d07e7e4b80059357 cc: net@freebsd.org Subject: Re: udp checksum on raw sockets X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2004 21:16:41 -0000 Hi, On Tue, Apr 27, 2004 at 10:05:43PM +0300, Ruslan Ermilov wrote: > Have the raw IP code set csum_flags |= CSUM_UDP (and set csum_data > correctly) in m->m_pkthdr, if ip_p == IPPROTO_UDP && uh_csum == 0. > Do the same thing for IPPROTO_TCP. Like I said, I'm willing to tackle this in the kernel, but for now I also need a userland-only solution. I guess I can fetch the IP address from the first ethernet iface and use that as the src address for the IP packet. Then I have enough information to calculate the UDP checksum in userland, don't I? Thanks Mark