From owner-freebsd-net@FreeBSD.ORG Tue Apr 27 11:23:51 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 D4D0816A4CE for ; Tue, 27 Apr 2004 11:23:51 -0700 (PDT) Received: from postman.ripe.net (postman.ripe.net [193.0.0.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C34243D39 for ; Tue, 27 Apr 2004 11:23:51 -0700 (PDT) (envelope-from marks@dell-laptop.6bone.nl) Received: by postman.ripe.net (Postfix, from userid 8) id 6CDA15DEBD; Tue, 27 Apr 2004 20:23:50 +0200 (CEST) Received: from birch.ripe.net (birch.ripe.net [193.0.1.96]) by postman.ripe.net (Postfix) with ESMTP id 26A075DEAF for ; Tue, 27 Apr 2004 20:23:50 +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 i3RINoVt004467 for ; Tue, 27 Apr 2004 20:23:50 +0200 Received: (nullmailer pid 4263 invoked by uid 1001); Tue, 27 Apr 2004 16:09:01 -0000 Date: Tue, 27 Apr 2004 18:09:01 +0200 From: Mark Santcroos To: net@freebsd.org Message-ID: <20040427160901.GA2552@laptop.6bone.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Handles: MS6-6BONE, MS18417-RIPE X-RIPE-Spam-Level: X-RIPE-Spam-Status: N 0.000007 / 0.0 / 0.0 / disabled X-RIPE-Signature: b69d628ebbf8dc7a28e98470f4da24d2 Subject: 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 18:23:51 -0000 * I'm sending UDP packets on a raw socket. * iphdr->ip_src.s_addr = INADDR_ANY; So I don't know the IP address that will be used as src address. So as far as I can see, I have a problem generating the checksum in userspace. Suggestion: Would it make sense that if: sysctl net.udp.checksum=1 and udphdr->uh_sum = 0; in a UDP packet created on a raw socket, to do the checksum in the kernel instead of leaving it zero? If it does, I can create a patch. Any other hints as how to do the checksum in userland are welcome too. As that is the "ultimate" problem I try to fix. Thanks Mark