Bug #663
closed
Multicast server is not responding on sensor network
Added by Hammel over 6 years ago.
Updated over 6 years ago.
Description
imlightsw is sending multicast announcement on sensor network but piboxd does not appear to be responding. I need to run debug on piboxd to see if it ever sees the request and, if it does, what happens when it tries to respond.
- Project changed from Iron Man to Monitor
- Category deleted (
Monitor)
- Status changed from New to In Progress
- % Done changed from 0 to 10
It seems to me that specifying INADDR_ANY for the interface to add to the multicast group will tell the kernel to "pick" an interface as opposed to "pick all" interfaces. In order to add all interfaces (or at least the ones we want here) we need to
- call getifaddr to get a list of interfaces
- iterate through the list of interfaces
- If type is INET and entry->ifa_name != "lo0" and entry->ifa_addr != NULL
- struct sockaddr *foo = entry->ifa_addr
- in_addr ip_addr = ((sockaddr_in)foo).sin_addr;
Then
mreq.imr_multiaddr.s_addr=inet_addr(MULTICAST_IP);
mreq.imr_interface.s_addr=htonl(ip_addr);
if (setsockopt(sd,IPPROTO_IP,IP_ADD_MEMBERSHIP,&mreq,sizeof(mreq)) < 0)
...
This way each interface is specifically added to the group.
- Status changed from In Progress to Closed
- % Done changed from 10 to 100
Implemented and tested on hardware. This fixes the problem of the monitor's piboxd not seeing the node's multicast request. Now it sees it.
Changes committed and pushed.
Closing issue.
Also available in: Atom
PDF