1

I have setup an independent network (that is not connected to any other devices) with four devices each of which are on a slightly different subnet. There is just a hub with the four devices connected to it.

  • Raspberry Pi: 10.10.0.1/24
  • Embedded Old: 10.11.0.1/24
  • Embedded New: 10.12.0.1/24
  • Mac: 10.13.0.1/24

enter image description here

We are sending a UDP broadcast using the following code:

import socket
UDP_IP_ADDRESS = "255.255.255.255"
UDP_PORT_NO = 5007
MESSAGE = "Hello, world!"
udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
udp_socket.sendto(bytes(MESSAGE, "utf-8"), (UDP_IP_ADDRESS, UDP_PORT_NO))
udp_socket.close()

And we have the following code on each device listening for the broadcast.

import socket
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)  # UDP
client.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
client.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
client.bind(("", 5007))
while True:
    data, addr = client.recvfrom(1024)
    print("received message: %s" % data)

The Mac, Raspberry Pi and the Embedded PC (old image) all receive the UDP broadcasts.

The Embedded PC (new image) will not receive the UDP broadcast. Interestingly the new image will receive the broadcast if the sender is on the same subnet.

The Embedded PC (old image) is running:

  • Kernel: 5.3
  • OE: Warrior

The Embedded PC (new image) is running:

  • Kernel: 6.1
  • OE: Kirkstone

Has anything changed between these versions that might prevent it from receiving UDP broadcasts? Is there a networkd setting that we need to make?

Update:

Nothing was received on a 255.255.255.255 broadcast:

Kernel Interface table
Iface            MTU   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0            1500      64     0     0 0           25     0     0     0 BMRU
lo             65536       0     0     0 0            0     0     0     0 LRU

----------> SEND BROADCAST PACKET
root@VIA-511723:~# netstat -i
Kernel Interface table
Iface            MTU   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0            1500      64     0     0 0           25     0     0     0 BMRU
lo             65536       0     0     0 0            0     0     0     0 LRU

but on a regular message it was:

root@VIA-511723:~# netstat -i
Kernel Interface table
Iface            MTU   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0            1500      64     0     0 0           25     0     0     0 BMRU
lo             65536       0     0     0 0            0     0     0     0 LRU

-----> SEND PACKET 192.168.10.255

root@VIA-511723:~# netstat -i
Kernel Interface table
Iface            MTU   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0            1500      65     0     0 0           25     0     0     0 BMRU
lo             65536       0     0     0 0            0     0     0     0 LRU 

Update 2

Going back to Kernel 5.3 (with Kirkstone) had the same problem.

3
  • How do you determine whether the device receives bcasts or not? The problem can't really be that the device with new image wouldn't receive bcasts from different subnet, it just doesn't accept them. My guess is that the new image has new NIC driver, which simply drops bcasts if they originate from a different subnet. Commented Apr 5, 2023 at 11:30
  • What's that packet look like on the wire? I seem to recall that macOS's network stack tends to convert the all-ones broadcast address to the subnet broadcast address on send, so your broadcasts might actually be addressed to 10.13.0.255 at the IP layer. Are any of your target devices' NICs in promiscuous mode?
    – Spiff
    Commented Apr 5, 2023 at 14:46
  • Can you try these commands? sysctl -w net.ipv4.conf.all.rp_filter=0; sysctl -w net.ipv4.conf.eth0.rp_filter=0
    – A.B
    Commented Apr 8, 2023 at 0:48

0

You must log in to answer this question.

Browse other questions tagged .