Project

General

Profile

Actions

Bug #663

closed

Multicast server is not responding on sensor network

Added by Hammel over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
-
Target version:
Start date:
12 Aug 2018
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

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.

Actions #1

Updated by Hammel over 5 years ago

  • Project changed from Iron Man to Monitor
  • Category deleted (Monitor)
Actions #2

Updated by Hammel over 5 years ago

  • 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.

Actions #3

Updated by Hammel over 5 years ago

Apparently, IBM agrees with me.

And here's an example of testing if each interface is a wireless interface or not.

Actions #4

Updated by Hammel over 5 years ago

  • 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.

Actions

Also available in: Atom PDF