From owner-freebsd-net@freebsd.org Wed Mar 6 12:53:26 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EE0915142D8 for ; Wed, 6 Mar 2019 12:53:26 +0000 (UTC) (envelope-from meka@tilda.center) Received: from mail.tilda.center (srv02.tilda.center [199.247.21.11]) by mx1.freebsd.org (Postfix) with ESMTP id 09FE78C7D4 for ; Wed, 6 Mar 2019 12:53:24 +0000 (UTC) (envelope-from meka@tilda.center) Received: from hal9000.home.meka.rs (178-223-64-96.dynamic.isp.telekom.rs [178.223.64.96]) by mail.tilda.center (Postfix) with ESMTPSA id 992F6180A2; Wed, 6 Mar 2019 13:53:22 +0100 (CET) Date: Wed, 6 Mar 2019 13:53:22 +0100 From: Goran =?utf-8?B?TWVracSH?= To: "Andrey V. Elsukov" Cc: freebsd-net@freebsd.org Subject: Re: UDP broadcast Message-ID: <20190306125322.f6v6cir4qtpfz2g5@hal9000.home.meka.rs> References: <20190305224610.frw5ov5bn6f3xaqg@hal9000.home.meka.rs> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tu22a7aba6iwggue" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: 09FE78C7D4 X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of meka@tilda.center designates 199.247.21.11 as permitted sender) smtp.mailfrom=meka@tilda.center X-Spamd-Result: default: False [-8.03 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[tilda.center]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.tilda.center]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[yandex.ru]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:20473, ipnet:199.247.16.0/21, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-2.77)[ip: (-9.57), ipnet: 199.247.16.0/21(-4.67), asn: 20473(0.48), country: US(-0.07)]; RECEIVED_SPAMHAUS_PBL(0.00)[96.64.223.178.zen.spamhaus.org : 127.0.0.11] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2019 12:53:26 -0000 --tu22a7aba6iwggue Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 06, 2019 at 03:37:04PM +0300, Andrey V. Elsukov wrote: > On 06.03.2019 01:46, Goran Meki=C4=87 wrote: > I think it is because netcat does not send real broadcast, you can add > -e flag to tcpdump and compare ethernet destination addresses. We might be on track here. I get this on router (first is nc from my machine, second is android app): tcpdump -e -nnSX -v -i bridge0 'dst 255.255.255.255 or src 192.168.5.80' tcpdump: listening on bridge0, link-type EN10MB (Ethernet), capture size 26= 2144 bytes 13:42:47.313189 bc:ae:c5:e1:31:d0 > 02:c9:63:0b:f4:00, ethertype IPv4 (0x08= 00), length 60: (tos 0x0, ttl 64, id 65271, offset 0, flags [none], proto U= DP (17), length 36) 192.168.5.94.26375 > 255.255.255.255.10024: UDP, length 8 0x0000: 4500 0024 fef7 0000 4011 b5cb c0a8 055e E..$....@......^ 0x0010: ffff ffff 6707 2728 0010 9ec8 2f69 6e66 ....g.'(..../inf 0x0020: 6f00 0000 0000 0000 0000 0000 0000 o............. 13:43:12.540319 bc:a5:8b:ad:71:4c > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x08= 00), length 50: (tos 0x0, ttl 64, id 26278, offset 0, flags [DF], proto UDP= (17), length 36) 192.168.5.79.34717 > 255.255.255.255.10024: UDP, length 8 0x0000: 4500 0024 66a6 4000 4011 0e2c c0a8 054f E..$f.@.@..,...O 0x0010: ffff ffff 879d 2728 0010 7e41 2f69 6e66 ......'(..~A/inf 0x0020: 6f00 0000 o... I checked, and 02:c9:63:0b:f4:00 is my router MAC, so I suppose the ff:ff:ff:ff:ff:ff should be what I see. Of course, I tried to write a simple C program that does the same, but just using 255.255.255.255 as IP address gives the same result as nc. Do I need to use raw sockets, perheps? Regards, meka --tu22a7aba6iwggue Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1WIFkXy2ZeMKjjKEWj1TknovrLYFAlx/wr8ACgkQWj1Tknov rLZWZw/9ECk7/cYktYr+lenNj2dGcqBjpErXGcrq47tWtwzuBtOZAOFpeK7Do5EJ 5eoSMbLgJ1FEY6G904caeHcT70/XWCLH66IrgAKZORatOWHz8hB5/YFO6tZh4zGg cFHzodn733wZY4hvRAhiq2yIWbID3Pow5wpxGLlBDpa4YOLzXslCOKDjJLSai6en 1biIU7ADEZXTmureZafz1YwuakgtT93rcpgzUod3Df8Lb88iMvG6DK/iIumUl27d eP80MiazIlqQG5NTSD47NPvOVUH+3cDekXRxX7LqIwRNrkifdLosuBRLKDhiSFXd UE6FMyl2MSm/uLCarV2xetGO9QS3aGv4fDUwSueU4zJFSJ0GkMVHp+CXXmakt1Cf dDiTt7nV9hxADOffVKRoJw/cQRGMAim9FNEPBD51MxShtcRjAAsvE8WUAi1TBOEj Z0ENAkRsmrTHMkKklU2wnRkWhxFp9wAQkn9REhNaAiwiZD4NvdGMC96n31crY5Bj 0m2PGF+/1iFK0QrnnE9u6Wb9eFJxfF7rKDsFH5NMfrz1NkQGATWRjBvTB3tcKjCG aEfz3JuL60zdazt3b0Nas1I83a35bkZ4je+O8UuDCrb7SdXvyZPebUU3ujGL6Jvm z0Y1mVgRyFlbyW3caY8Gerzu3FrcW4nBLOo1u5AWI8AjCO5Anzc= =3gOP -----END PGP SIGNATURE----- --tu22a7aba6iwggue--