Skip to content

Commit

Permalink
improve multicast check, remove broadcast check
Browse files Browse the repository at this point in the history
If an interface does not support IFF_MULTICAST, force UnicodeOnly.
Also, there's not reason to check IFF_BROADCAST since IPv6 uses
multicast, not broadcast.
  • Loading branch information
Reuben committed Apr 13, 2013
1 parent ed12aaf commit 0c4dfeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGES
@@ -1,3 +1,6 @@
2013/04/13 Force UnicodeOnly if IFF_MULTICAST is unavailable
Remove check for IFF_BROADCAST since it isn't used

2013/03/14 Fix for systems without sysctl.h from vapier
Updating to version 1.9.3
release 1.9.3
Expand Down
15 changes: 4 additions & 11 deletions device-common.c
Expand Up @@ -39,25 +39,18 @@ check_device(struct Interface *iface)
flog(LOG_ERR, "interface %s is not UP", iface->Name);
return (-1);
}

if (!(ifr.ifr_flags & IFF_RUNNING))
{
if (!iface->IgnoreIfMissing)
flog(LOG_ERR, "interface %s is not RUNNING", iface->Name);
return (-1);
}

if (! iface->UnicastOnly && !(ifr.ifr_flags & IFF_MULTICAST))
{
flog(LOG_WARNING, "interface %s does not support multicast",
iface->Name);
flog(LOG_WARNING, " do you need to add the UnicastOnly flag?");
}

if (! iface->UnicastOnly && !(ifr.ifr_flags & IFF_BROADCAST))
if (!iface->UnicastOnly && !(ifr.ifr_flags & IFF_MULTICAST))
{
flog(LOG_WARNING, "interface %s does not support broadcast",
iface->Name);
flog(LOG_WARNING, " do you need to add the UnicastOnly flag?");
flog(LOG_INFO, "interface %s does not support multicast, forcing UnicastOnly", iface->Name);
iface->UnicastOnly = 1;
}

return 0;
Expand Down

0 comments on commit 0c4dfeb

Please sign in to comment.