stop receiving multicast packets after extended use


This is an update to the “stop receiving after 2 hours” post.

After an extended period of time, it appears that a multicast socket will only receive messages from a single source. If a unicast message is received from the desired source, on the same port, multicast communications are restored.

The basic sequence of network calls is this:

udp_extopen(&unisock, IF_ETH0, VDU_CMD_PORT, -1, 0, commandif_handler, 0, 0);

ip = inet_addr(VDU_CMD_MCAST_IP);
udp_extopen(&sock, IF_ETH0, VDU_CMD_PORT, ip, 0, commandif_handler,0, 0);

// Later a button is pressed

udp_bypass_arp(&unisock, &mac_address);
udp_sendto(&unisock, &msg, 14, ip, port);

// The replay is received on unisock
// After the 2 hour mark, the IP stack stalls

When everything is working, the communication sequence is:
a. send message on unicast socket, bypassing ARP
b. receive response on unicast socket
c. receive multicast on “sock” from the same source as the unicast response

Why would this message sequence kill UDP socket communications?