You are not logged in.
Pages: 1
Hi all,
My program sends (and receives) IPv6 multicast packets (ff02::blah) over all of the local Ethernet links; at startup it calls getifaddrs() to find out what Ethernet devices are available to be multicast over.
This all works fine; my problem arises when the user changes the set of active Ethernet devices (e.g. by plugging or unplugging an Ethernet cable, or by enabling/disabling WiFi). When this happens, the list of Ethernet devices I cached at program startup is out-of-date; my program is likely now trying to send multicast packets over a network device that is no longer available; or conversely it may be failing to send multicast packets over a new network device that just became available.
In any case, what I need is some way for my program to be notified when the set of available network interfaces changes; when I get that notification I can then call getifaddrs() again and assemble a new list of network interfaces to use. With a bit of googling I was able to discover how to get this notification under MacOS/X (via the System Configuration framework) and under Windows XP (via NotifyAddrChange() and/or NotifyIpInterfaceChange()). I still haven't discovered the Linux way to do this, however, short of brute-forcing it by running a polling loop that calls getifaddrs() every few seconds and compares the results to the previous set. Perhaps someone knows how this is done?
Thanks,
Jeremy
Offline
Offline
Hi jfriesne , RobSeace
I am currently facing same problem and while doing google search came across this site.
I am looking for similar solution. Needed to check if you have the code available and can share it, please let me know.
Pages: 1