Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 2007 16:57:01 +0000
From:      Bruce M Simpson <bms@incunabulum.net>
To:        net@FreeBSD.org
Subject:   [TEST ATTACHED] Inconsistencies with IP_ONESBCAST and/or IP_SENDSRCADDR
Message-ID:  <45C0CA5D.5090903@incunabulum.net>

next in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45C0CA5D.5090903>