Skip to content

Commit

Permalink
Fix #39: allow use of loopback interface for routing
Browse files Browse the repository at this point in the history
The loopback interface should be allowed once the multicast flag has
been enabled (with `ip link set multicast on dev lo`).

Enabling mrouted on a loopback interface work just fine on Linux.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Sep 20, 2020
1 parent 61767ba commit 9961051
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ void config_vifs_from_kernel(void)
/*
* Ignore any interface for an address family other than IP.
*/
if (!ifa->ifa_addr || ifa->ifa_addr->sa_family != AF_INET)
if (!ifa->ifa_addr || ifa->ifa_addr->sa_family != AF_INET) {
logit(LOG_INFO, 0, "skipping (this instance of) %s, no IPv4 address.", ifa->ifa_name);
continue;
}

/*
* Ignore loopback interfaces and interfaces that do not support
* multicast.
* Ignore interfaces that do not support multicast.
*/
flags = ifa->ifa_flags;
if ((flags & (IFF_LOOPBACK|IFF_MULTICAST)) != IFF_MULTICAST)
if (!(flags & IFF_MULTICAST)) {
logit(LOG_INFO, 0, "skipping %s, does not support multicast.", ifa->ifa_name);
continue;
}

/*
* Perform some sanity checks on the address and subnet, ignore any
Expand Down

0 comments on commit 9961051

Please sign in to comment.