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

Meyer, Wolfgang wolfgang.meyer at hob.de
Thu Aug 25 07:46:40 UTC 2016



> -----Original Message-----
> From: owner-freebsd-net at freebsd.org [mailto:owner-freebsd-
> net at 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 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at 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


More information about the freebsd-net mailing list