RE: How can I send packets to 255.255.255.255 from the command line?

2016-08-25 Thread Meyer, Wolfgang


> -Original Message-
> From: owner-freebsd-...@freebsd.org [mailto:owner-freebsd-
> n...@freebsd.org] On Behalf Of Ryan Stone
> Sent: Donnerstag, 18. August 2016 21:30
> To: freebsd-net
> Subject: How can I send packets to 255.255.255.255 from the command line?
>
> I want to test a change to broadcast packet handling and I want to confirm
> that 255.255.255.255 is still handled correctly. Are there any command-line
> tools in FreeBSD that can send to the broadcast address?  ping
> 255.255.255.255 does not work correctly, unfortunately.
> ___
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Hello,

this is a long-standing bug in the FreeBSD network implementation. The 
situation has not changed since the examination done in comment 10 of this 
problem report:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=99558

In order to be able to send packets to the 255.255.255.255 IP address you need 
to change the kernel sources. I have developed a patch (actually two of them) 
that allows to work around the problem. The first approach looks for the first 
network interface that is configured for broadcasting and sends the broadcast 
to its network broadcast address. This should be in conformance to the RFCs 
that leave it to the implementation whether to do the broadcast on an arbitraty 
network interface or on all of them. In my second attempt to tackle the problem 
I am looking in addition at the source address of the IP packet and try to find 
a network interface that is in the same local network as the source IP address. 
The code changes in the second approach are probably a bit more hackish and 
might need some further testing.

If you are interested I can provide you with the changes. They are based on 
10-stable or 11-stable as of not to long ago. As the to-be-patched sources do 
not change a lot the patches should be applicable with no problems. Of course I 
(or rather my company) would like to see the bug fixed in the FreeBSD sources 
and would be sympathetic to a review of the patches in the hope to include them 
in the official sources.

Regards,
Wolfgang




Follow HOB:

- HOB: http://www.hob.de/redirect/hob.html
- Xing: http://www.hob.de/redirect/xing.html
- LinkedIn: http://www.hob.de/redirect/linkedin.html
- HOBLink Mobile: http://www.hob.de/redirect/hoblinkmobile.html
- Facebook: http://www.hob.de/redirect/facebook.html
- Twitter: http://www.hob.de/redirect/twitter.html
- YouTube: http://www.hob.de/redirect/youtube.html
- E-Mail: http://www.hob.de/redirect/mail.html


HOB GmbH & Co. KG
Schwadermuehlstr. 3
D-90556 Cadolzburg

Geschaeftsfuehrung: Klaus Brandstaetter, Zoran Adamovic

AG Fuerth, HRA 5180
Steuer-Nr. 218/163/00107
USt-ID-Nr. DE 132747002

Komplementaerin HOB electronic Beteiligungs GmbH
AG Fuerth, HRB 3416
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: How can I send packets to 255.255.255.255 from the command line?

2016-08-19 Thread Charles Smith
It is still limited to the "local network," about as harmless as a DHCP 
broadcast.

- Charles



Sent from my iPhone
> On Aug 19, 2016, at 11:15 AM, Valeri Galtsev  
> wrote:
> 
> 
>> On Fri, August 19, 2016 9:46 am, Andrey V. Elsukov wrote:
>>> On 18.08.16 22:29, Ryan Stone wrote:
>>> I want to test a change to broadcast packet handling and I want to
>>> confirm
>>> that 255.255.255.255 is still handled correctly. Are there any
>>> command-line
>>> tools in FreeBSD that can send to the broadcast address?  ping
>>> 255.255.255.255 does not work correctly, unfortunately.
>> 
>> There is one in src/tools/regression/netinet/ipbroadcast
>> You can build it with command
>> # make WARNS=0
>> 
> 
> Am I the only one who is kind of kicked out of the chair when seeing
> someone attempting to broadcast the who ipv4 internet: 255.255.255.255 ?!
> Someone explain me this is OK and is not a "big bang" level of noise ;-(
> 
> Valeri
> 
>> --
>> WBR, Andrey V. Elsukov
>> 
>> 
> 
> 
> 
> Valeri Galtsev
> Sr System Administrator
> Department of Astronomy and Astrophysics
> Kavli Institute for Cosmological Physics
> University of Chicago
> Phone: 773-702-4247
> 
> ___
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: How can I send packets to 255.255.255.255 from the command line?

2016-08-19 Thread Valeri Galtsev

On Fri, August 19, 2016 9:46 am, Andrey V. Elsukov wrote:
> On 18.08.16 22:29, Ryan Stone wrote:
>> I want to test a change to broadcast packet handling and I want to
>> confirm
>> that 255.255.255.255 is still handled correctly. Are there any
>> command-line
>> tools in FreeBSD that can send to the broadcast address?  ping
>> 255.255.255.255 does not work correctly, unfortunately.
>
> There is one in src/tools/regression/netinet/ipbroadcast
> You can build it with command
> # make WARNS=0
>

Am I the only one who is kind of kicked out of the chair when seeing
someone attempting to broadcast the who ipv4 internet: 255.255.255.255 ?!
Someone explain me this is OK and is not a "big bang" level of noise ;-(

Valeri

> --
> WBR, Andrey V. Elsukov
>
>



Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: How can I send packets to 255.255.255.255 from the command line?

2016-08-19 Thread Andrey V. Elsukov
On 18.08.16 22:29, Ryan Stone wrote:
> I want to test a change to broadcast packet handling and I want to confirm
> that 255.255.255.255 is still handled correctly. Are there any command-line
> tools in FreeBSD that can send to the broadcast address?  ping
> 255.255.255.255 does not work correctly, unfortunately.

There is one in src/tools/regression/netinet/ipbroadcast
You can build it with command
# make WARNS=0

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


Re: How can I send packets to 255.255.255.255 from the command line?

2016-08-18 Thread Kyle Evans
Hello!

Is netcat [nc(1)] an option? It doesn't seem to have any objections to
doing this, but I don't have a setup to test it properly with at the
moment.

Thanks,

Kyle Evans

On Thu, Aug 18, 2016 at 2:29 PM, Ryan Stone  wrote:
> I want to test a change to broadcast packet handling and I want to confirm
> that 255.255.255.255 is still handled correctly. Are there any command-line
> tools in FreeBSD that can send to the broadcast address?  ping
> 255.255.255.255 does not work correctly, unfortunately.
> ___
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: How can I send packets to 255.255.255.255 from the command line?

2016-08-18 Thread Paul Thornton

On 18/08/2016 21:55, Ryan Stone wrote:

On Thu, Aug 18, 2016 at 4:48 PM, Paul A. Procacci 
wrote:


You should be able to ping the local subnet.
Alternatively you can use net/arping.

~Paul



I'm specifically looking to test the handling of 255.255.255.255, so a
local broadcast address is out.  Unfortunately, arping doesn't seem to do
the right thing on FreeBSD.  It manages to get the kernel to try arp'ing
for 255.255.255.255.


This very likely comes under the heading of "horrible bodges" but when I 
needed to do this, after much experimenting I added a static route to 
255.255.255.0/24 pointing to the local LAN broadcast address.


For example, on a machine with address 192.168.10.10/24 the "fix" would be:
route add 255.255.255.0/24 192.168.10.255

My code could then happily send UDP to 255.255.255.255 without issue, 
and the packets make it out onto the wire with a broadcast destination 
MAC address.


This was under 10.1-RELEASE; things may have changed that make it no 
longer work.


I did warn you that it came under the heading of "horrible bodges" :)

Paul.
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


Re: How can I send packets to 255.255.255.255 from the command line?

2016-08-18 Thread Ryan Stone
On Thu, Aug 18, 2016 at 4:48 PM, Paul A. Procacci 
wrote:

> You should be able to ping the local subnet.
> Alternatively you can use net/arping.
>
> ~Paul
>

I'm specifically looking to test the handling of 255.255.255.255, so a
local broadcast address is out.  Unfortunately, arping doesn't seem to do
the right thing on FreeBSD.  It manages to get the kernel to try arp'ing
for 255.255.255.255.
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"


How can I send packets to 255.255.255.255 from the command line?

2016-08-18 Thread Ryan Stone
I want to test a change to broadcast packet handling and I want to confirm
that 255.255.255.255 is still handled correctly. Are there any command-line
tools in FreeBSD that can send to the broadcast address?  ping
255.255.255.255 does not work correctly, unfortunately.
___
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"