From owner-freebsd-net@FreeBSD.ORG Wed Jan 31 16:57:03 2007 Return-Path: X-Original-To: net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE8A116A403 for ; Wed, 31 Jan 2007 16:57:03 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id B06D213C49D for ; Wed, 31 Jan 2007 16:57:03 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id 22E949E0A9 for ; Wed, 31 Jan 2007 11:57:03 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by out1.internal (MEProxy); Wed, 31 Jan 2007 11:57:03 -0500 X-Sasl-enc: jaoTba1GJVw94X55UUYCl4NQZAlWbxrLJeYtdIjm46bZ 1170262622 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 78F7711BF for ; Wed, 31 Jan 2007 11:57:02 -0500 (EST) Message-ID: <45C0CA5D.5090903@incunabulum.net> Date: Wed, 31 Jan 2007 16:57:01 +0000 From: Bruce M Simpson User-Agent: Thunderbird 1.5.0.9 (X11/20070125) MIME-Version: 1.0 To: net@FreeBSD.org Content-Type: multipart/mixed; boundary="------------010507050407010806050504" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: [TEST ATTACHED] Inconsistencies with IP_ONESBCAST and/or IP_SENDSRCADDR 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: Wed, 31 Jan 2007 16:57:04 -0000 This is a multi-part message in MIME format. --------------010507050407010806050504 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, In preparation for tightening up our handling of INADDR_BROADCAST sends, I ran some brief tests today on the network stack with the attached test code. I found some inconsistencies when run against 6.2-RELEASE; 1. IP_ONESBCAST breaks if SO_DONTROUTE is specified. One thing appears to be consistent about the failure mode: bad UDP checksums. dc(4) is being used on the destination end of the test network, so checksum offloading should not be an issue. I am also seeing the wrong destination address being used in most cases. This is intermittent regardless of whether the socket is bound or unbound. 2. IP_SENDSRCADDR has some other inconsistencies. a. The option is always rejected if the socket is not bound. I find this behaviour suspect; the whole point of the option is to specify, for SOCK_DGRAM and SOCK_RAW, the source address of a packet. b. 0.0.0.0 is always accepted. A regular interface lookup is used based on destination if this is specified. This appears suspect to me because such an option is redundant. In theory a developer should be able to write code which uses SO_DONTROUTE and IP_SENDSRCADDR to bypass the routing table lookup when sending to 255.255.255.255. Currently this doesn't appear to be the case, though IP_SENDSRCADDR is a separate issue from IP_ONESBCAST. Regards, BMS --------------010507050407010806050504--