From daved@wolf.tamu.edu  Fri Apr 26 07:37:46 2002
Return-Path: <daved@wolf.tamu.edu>
Received: from wolf.tamu.edu (wolf.tamu.edu [128.194.177.13])
	by hub.freebsd.org (Postfix) with ESMTP id 1F2F837B400
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Apr 2002 07:37:46 -0700 (PDT)
Received: (from daved@localhost)
	by wolf.tamu.edu (8.11.6/8.11.6) id g3QEbj302031;
	Fri, 26 Apr 2002 09:37:45 -0500 (CDT)
	(envelope-from daved)
Message-Id: <200204261437.g3QEbj302031@wolf.tamu.edu>
Date: Fri, 26 Apr 2002 09:37:45 -0500 (CDT)
From: David J Duchscher <daved@tamu.edu>
Reply-To: David J Duchscher <daved@tamu.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Bug in network stack in sending broadcast packets
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         37486
>Category:       kern
>Synopsis:       Bug in network stack in sending broadcast packets
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 26 07:40:01 PDT 2002
>Closed-Date:    Tue Sep 09 12:12:52 PDT 2003
>Last-Modified:  Tue Sep 09 12:12:52 PDT 2003
>Originator:     David J Duchscher
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Texas A&M University
>Environment:
System: FreeBSD wolf.tamu.edu 4.5-STABLE FreeBSD 4.5-STABLE #3: Thu Apr 18 16:15:06 CDT 2002 root@wolf.tamu.edu:/usr/obj/usr/src/sys/CUSTOM i386

>Description:

	Found that after using ifconfig to reconfigure the interface,
	all ones broadcast (255.255.255.255) can be sent.  Before
	being reconfigured, the all ones broadcasts would be converted
	to a subnet broadcast which I believe is the desired behavior.

>How-To-Repeat:

	Just reconfigure the interface and you will be able to send
	all ones broadcast packets.  You do not have to change the
	configuration of the interface, just issuing an ifconfig with
	the same settings will work.  The steps I took on
	reconfiguring the interface where:

	  ifconfig fxp0 inet 10.1.4.1 broadcast 255.255.255.0
	  add route default 10.1.4.1

	I used the following perl code to send the broadcast packets:

	  use IO::Socket;

	  $sock = new IO::Socket::INET ( LocalPort => 10000,
		                         Proto     => 'udp');
          $sock->sockopt(SO_BROADCAST, 1);
	  $dest = sockaddr_in(10000, inet_aton("255.255.255.255"));
	  $sock->send("weeee", undef, $dest);

	Used tcpdump to on same machine and another machine to
	confirm.  I have not found a way return to the behavior of
	sending out subnet broadcast packets besides the obvious
	reboot.

>Fix:

	
>Release-Note:
>Audit-Trail:

From: David J Duchscher <daved@tamu.edu>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: kern/37486: Bug in network stack in sending broadcast packets
Date: Fri, 26 Apr 2002 09:37:45 -0500 (CDT)

 >Number:         37486
 >Category:       kern
 >Synopsis:       Bug in network stack in sending broadcast packets
 >Confidential:   no
 >Severity:       non-critical
 >Priority:       low
 >Responsible:    freebsd-bugs
 >State:          analyzed
 >Quarter:        
 >Keywords:       
 >Date-Required:
 >Class:          sw-bug
 >Submitter-Id:   current-users
 >Arrival-Date:   Fri Apr 26 07:40:01 PDT 2002
 >Closed-Date:
 >Last-Modified:
 >Originator:     David J Duchscher
 >Release:        FreeBSD 4.5-STABLE i386
 >Organization:
 Texas A&M University
 >Environment:
 System: FreeBSD wolf.tamu.edu 4.5-STABLE FreeBSD 4.5-STABLE #3: Thu Apr 18 16:15:06 CDT 2002 root@wolf.tamu.edu:/usr/obj/usr/src/sys/CUSTOM i386
 
 >Description:
 
 	Found that after using ifconfig to reconfigure the interface,
 	all ones broadcast (255.255.255.255) can be sent.  Before
 	being reconfigured, the all ones broadcasts would be converted
 	to a subnet broadcast which I believe is the desired behavior.
 
 >How-To-Repeat:
 
 	Just reconfigure the interface and you will be able to send
 	all ones broadcast packets.  You do not have to change the
 	configuration of the interface, just issuing an ifconfig with
 	the same settings will work.  The steps I took on
 	reconfiguring the interface where:
 
 	  ifconfig fxp0 inet 10.1.4.1 broadcast 255.255.255.0
 	  add route default 10.1.4.1
 
 	I used the following perl code to send the broadcast packets:
 
 	  use IO::Socket;
 
 	  $sock = new IO::Socket::INET ( LocalPort => 10000,
 		                         Proto     => 'udp');
           $sock->sockopt(SO_BROADCAST, 1);
 	  $dest = sockaddr_in(10000, inet_aton("255.255.255.255"));
 	  $sock->send("weeee", undef, $dest);
 
 	Used tcpdump to on same machine and another machine to
 	confirm.  I have not found a way return to the behavior of
 	sending out subnet broadcast packets besides the obvious
 	reboot.
 
 >Fix:
 
 	
 >Release-Note:
 >Audit-Trail:
 >Unformatted:
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
 
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: kris 
Responsible-Changed-When: Mon Jul 14 04:20:31 PDT 2003 
Responsible-Changed-Why:  
Assign to net mailing list for evaluation 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37486 
Responsible-Changed-From-To: freebsd-net->wes 
Responsible-Changed-By: wes 
Responsible-Changed-When: Wed Jul 16 11:26:15 PDT 2003 
Responsible-Changed-Why:  
I'm working on all-call broadcasting code already, I'll fix this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37486 
Responsible-Changed-From-To: wes->bms 
Responsible-Changed-By: wes 
Responsible-Changed-When: Thu Aug 21 22:36:04 PDT 2003 
Responsible-Changed-Why:  
Bruce has already fixed this in -current and will soon MFC. 
Or at least something like it. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=37486 
State-Changed-From-To: open->patched 
State-Changed-By: bms 
State-Changed-When: Tue 2 Sep 2003 19:46:16 PDT 
State-Changed-Why:  
I've committed a fix for the fix. -CURRENT's behaviour is correct in 
this regard. I am seeking permission from re@ to MFC this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37486 
State-Changed-From-To: patched->closed 
State-Changed-By: bms 
State-Changed-When: Tue 9 Sep 2003 12:10:42 PDT 
State-Changed-Why:  
The fix has been approved by re@ today and MFC'd. Please use the new socket 
option to get the correct behaviour in your applications. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37486 
>Unformatted:
