Date: Tue, 5 Mar 2019 23:46:10 +0100 From: Goran =?utf-8?B?TWVracSH?= <meka@tilda.center> To: freebsd-net@freebsd.org Subject: UDP broadcast Message-ID: <20190305224610.frw5ov5bn6f3xaqg@hal9000.home.meka.rs>
next in thread | raw e-mail | index | archive | help
--2a3j36kn3vh2ku6h Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hello, I have a audio mixer which is controleable over network via android app. The discovery is done by sending broadcast UDP message "/info\0\0\0" to 255.255.255.255 (checked by tcpdump on the router). I thought I can do the same with: printf "/info\0\0\0" | nc -4u -w 0 255.255.255.255 10024 But I never get the reply. This is what tcpdump sees: tcpdump -nnSX -v 'src 192.168.5.80 or dst 255.255.255.255' tcpdump: listening on re0, link-type EN10MB (Ethernet), capture size 262144 bytes 23:41:25.595663 IP (tos 0x0, ttl 64, id 28810, offset 0, flags [none], proto UDP (17), length 36, bad cksum 0 (->4439)!) 192.168.5.94.36465 > 255.255.255.255.10024: UDP, length 8 0x0000: 4500 0024 708a 0000 4011 0000 c0a8 055e E..$p...@......^ 0x0010: f fff ffff 8e71 2728 0010 c627 2f69 6e66 .....q'(...'/inf 0x0020: 6f00 0000 o... I never get any reply, but when I try the same with the android app while sniffing on the router: tcpdump -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 262144 bytes 23:43:52.165821 IP (tos 0x0, ttl 64, id 20743, offset 0, flags [DF], proto UDP (17), length 36) 192.168.5.79.57477 > 255.255.255.255.10024: UDP, length 8 0x0000: 4500 0024 5107 4000 4011 23cb c0a8 054f E..$Q.@.@.#....O 0x0010: ffff ffff e085 2728 0010 2559 2f69 6e66 ......'(..%Y/inf 0x0020: 6f00 0000 o... 23:43:52.171565 IP (tos 0x0, ttl 128, id 8, offset 0, flags [none], proto UDP (17), length 84) 192.168.5.80.10024 > 192.168.5.79.57477: UDP, length 56 0x0000: 4500 0054 0008 0000 8011 aea1 c0a8 0550 E..T...........P 0x0010: c0a8 054f 2728 e085 0040 2677 2f69 6e66 ...O'(...@&w/inf 0x0020: 6f00 0000 2c73 7373 7300 0000 5630 2e30 o...,ssss...V0.0 0x0030: 3400 0000 5852 3138 2d32 372d 3031 2d34 4...XR18-27-01-4 0x0040: 3700 0000 5852 3138 0000 0000 312e 3039 7...XR18....1.09 0x0050: 0000 0000 .... So what am I doing wrong and how can I send UDP broadcast from either script of C code? Thank you! Regards, meka --2a3j36kn3vh2ku6h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1WIFkXy2ZeMKjjKEWj1TknovrLYFAlx+/DIACgkQWj1Tknov rLYeGQ//W15qImKqQ1ELNJA/LgULPhyVN8Jfk6UbxZ6XH+IabqRhb1gDPF1SxmAY JPxd5lprGreKDKdnpkw87Powp0KzHOK/+d2Zg73XMx7M+4liRQX6KEfGu5gQ0mKr oi8y2peLmW8MfvDxw8QwoLQo/Q03AR9OHPVEUOI+Bg4n6ZGzv36yPfEZPjUIchE3 s5i1xZNkv+wnrAIdXFtFovD7w+5Qjg4Pvl/n/qVjOUBtGsKse5eOEbcfEoTNT5fv toGPRNtD7JbBV3GTv3xj3lK6YqqIMB7ML2e3xEsWYYbjmmW9bDcKvYQOzFVoqZCY NRoA0Fs4o4I7RhRKh7qyae6XIwatU9uHAvwGUWg9iz/6lTqPsm2lBxrQk3rNW5jO FsVzlQcAzG6VaZwuN528itqM7N6mplzV4EM+8pgSZfMCon9T4JCeySBx4VR+eim8 jQp1k+qxrx3k8EDdhJt8sBIIzJkwSmKFz+pdGzYlRTxiHn16z9euRgTXWiJOFi1/ FnPqAprkM87hGbH25WMHn4sGo47QOI8Hi83PuEzh+PCe09iFa7TIUW93s3X+HWEs MMFNKuz4pgi8Ukaa/oPcIB41v3t/YGQKhIpzQAaMQNgM5QMuuizM5Ac/VQcPltps 2Tefmc1h7oC2n/DbecDEhg8Gf0mt/B6AjGen1Gg9q8H0uQaLCIc= =vYbS -----END PGP SIGNATURE----- --2a3j36kn3vh2ku6h--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190305224610.frw5ov5bn6f3xaqg>