From owner-freebsd-net@freebsd.org Thu Aug 25 07:46:40 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37013BC3935 for ; Thu, 25 Aug 2016 07:46:40 +0000 (UTC) (envelope-from wolfgang.meyer@hob.de) Received: from hobex19.hob.de (hobex19.hob.de [212.185.199.31]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hobex19", Issuer "hobex19" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9745C1C8F for ; Thu, 25 Aug 2016 07:46:38 +0000 (UTC) (envelope-from wolfgang.meyer@hob.de) Received: from HOBEX12.hob.de (172.22.1.12) by hobex19.hob.de (172.25.1.31) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 25 Aug 2016 09:45:12 +0200 Received: from HOBEX11.hob.de ([fe80::b99f:1c54:7122:49b4]) by HOBEX12.hob.de ([::1]) with mapi id 14.02.0387.000; Thu, 25 Aug 2016 09:45:22 +0200 From: "Meyer, Wolfgang" To: 'Ryan Stone' , freebsd-net Subject: RE: How can I send packets to 255.255.255.255 from the command line? Thread-Topic: How can I send packets to 255.255.255.255 from the command line? Thread-Index: AQHR+YbsURANEmb+zUKaFJNZY6P1dKBZTb2g Date: Thu, 25 Aug 2016 07:45:22 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.24.71.140] old-x-esetresult: clean, is OK old-x-esetid: 4EB48F3AB80C295219F2D5 x-esetresult: clean, is OK x-esetid: 4EB48F3AB80C295219F2D5 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 07:46:40 -0000 > -----Original Message----- > From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd- > net@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 confir= m > that 255.255.255.255 is still handled correctly. Are there any command-li= ne > 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-unsubscribe@freebsd.org" Hello, this is a long-standing bug in the FreeBSD network implementation. The situ= ation has not changed since the examination done in comment 10 of this prob= lem report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D99558 In order to be able to send packets to the 255.255.255.255 IP address you n= eed 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 conforman= ce to the RFCs that leave it to the implementation whether to do the broadc= ast on an arbitraty network interface or on all of them. In my second attem= pt 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 Free= BSD 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