I have a program which attempts to contact to an embedded device over UDP. The embedded device has a link-local address only (169.254..); the Linux host has a normal (DHCP, RFC1918) address, managed by NetworkManager on ubuntu natty. This local connection is configured to 'use this connection only for resources on the local network'. My program sends a broadcast packet on one socket, then waits on a unicast socket (bound to the local address, not connect()ed) for an incoming beacon packet
At times, I find that the Linux program does not receive packets from the link-local address of the embedded device. Wireshark shows that they are arriving on the incoming interface and are well-formed, but they are not received. Packets sent locally both from and to the RFC1918 local address are, however received, as are packets from other RFC1918 hosts on the same netowrk.
I also find that, upon rebooting, this condition usually spontaneously corrects itself; I can once again receive packets from link-local addresses. Sometimes it also spontaneously corrects itself after just waiting some time.
Is there some obscure route setting or something that could cause the incoming packets to be lost? Outgoing packets work fine (probably because I'm bypassing routing when sending packets).
Correlating the last case of spontaneous restoration, I find this in the logs:
Jul 13 20:58:01 hakase NetworkManager[933]: <info> (eth0): DHCPv4 state changed preinit -> reboot
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) scheduled...
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) started...
Jul 13 20:58:01 hakase NetworkManager[933]: <info> address 192.168.0.148
Jul 13 20:58:01 hakase NetworkManager[933]: <info> prefix 24 (255.255.255.0)
Jul 13 20:58:01 hakase NetworkManager[933]: <info> gateway 192.168.0.1
Jul 13 20:58:01 hakase NetworkManager[933]: <info> nameserver '192.168.0.1'
Jul 13 20:58:01 hakase NetworkManager[933]: <info> domain name 'mshome.net'
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Scheduling stage 5
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled...
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Done scheduling stage 5
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete.
Jul 13 20:58:01 hakase NetworkManager[933]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started...
Jul 13 20:58:01 hakase avahi-daemon[862]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.148.
Jul 13 20:58:01 hakase avahi-daemon[862]: New relevant interface eth0.IPv4 for mDNS.
Jul 13 20:58:01 hakase avahi-daemon[862]: Registering new address record for 192.168.0.148 on eth0.IPv4.
Jul 13 20:58:02 hakase NetworkManager[933]: <info> Policy set 'Auto dfn3' (wlan0) as default for IPv4 routing and DNS.
Jul 13 20:58:02 hakase NetworkManager[933]: <info> (eth0): device state change: 7 -> 8 (reason 0)
Jul 13 20:58:02 hakase NetworkManager[933]: <info> Activation (eth0) successful, device activated.
Jul 13 20:58:02 hakase NetworkManager[933]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete.
Jul 13 20:58:03 hakase postfix/master[1245]: reload -- version 2.8.2, configuration /etc/postfix
[these next two lines are likely associated with the wireshark session I have running]
Jul 13 20:58:09 hakase kernel: [37294.962058] device eth0 left promiscuous mode
Jul 13 20:58:10 hakase kernel: [37295.323279] device eth0 entered promiscuous mode
Jul 13 20:58:11 hakase ntpdate[23459]: adjust time server 91.189.94.4 offset -0.024960 sec
Jul 13 21:02:40 hakase dhclient: DHCPREQUEST of 192.168.0.148 on eth0 to 192.168.0.1 port 67
Jul 13 21:02:40 hakase dhclient: DHCPACK of 192.168.0.148 from 192.168.0.1
Jul 13 21:02:40 hakase dhclient: bound to 192.168.0.148 -- renewal in 248 seconds.
Jul 13 21:02:40 hakase NetworkManager[933]: <info> (eth0): DHCPv4 state changed reboot -> renew
Jul 13 21:02:40 hakase NetworkManager[933]: <info> address 192.168.0.148
Jul 13 21:02:40 hakase NetworkManager[933]: <info> prefix 24 (255.255.255.0)
Jul 13 21:02:40 hakase NetworkManager[933]: <info> gateway 192.168.0.1
Jul 13 21:02:40 hakase NetworkManager[933]: <info> nameserver '192.168.0.1'
Jul 13 21:02:40 hakase NetworkManager[933]: <info> domain name 'mshome.net'
[at approximately one second later the connection to the link-local device was established]
Could this 'reboot' state be linked with the problem somehow?