Udp Broadcast Sendto Failed:"Network Is Unreachable" on Linux 2.6.30

c sendto function sets “network is unreachable” errno in linux2.6.29

Your code is fine. The problem is in your network administration.

You are missing a default route. The default route might be provided by your DHCP server, you might have to specify it in your network config files, or you might have to issue a command like route add default gw 192.0.2.1.

UDP broadcast breaks after some time on Linux 2.6.33.9 rt

Binding the socket to a device specific broadcast address, in my case 192.168.5.255, fixes the bug. I have no idea why this happens but it works.

IOException Network is unreachable

The network unreachable message is an ICMP message. When a host tries to reach another host on a different network, it sends the layer-3 packet to its configured gateway. If the gateway ( or any router in the path) doesn't know how to reach the other network, it will generate an ICMP message and send it back to the host.



Related Topics



Leave a reply



Submit