diff options
author | Jon Franklin <jvfranklin@gmail.com> | 2020-03-26 13:22:29 -0500 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2020-03-28 18:41:46 +0100 |
commit | 8086a3db780f8a4ee6943a3ef2f774fc78105327 (patch) | |
tree | 748e9a4367d3a01679d419f4f08034081c38d21a /llmnrd.c | |
parent | fdf702ec67f8eefbd3ad5bb63f193dce01ef6201 (diff) |
llmnrd: don't exit on SO_BINDTODEVICE failure
The -i option requires running llmnrd as root for SO_BINDTODEVICE to
work. Packets are still filtered based on interface because only rtnl
messages for addresses of the specified interface are considered in
iface_nlmsg_change_addr. Instead log a warning only if SO_BINDTODEVICE
fails.
Signed-off-by: Jon Franklin <jvfranklin@gmail.com>
[tk: small adjustments to commit message, check return value of iface_init]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'llmnrd.c')
-rw-r--r-- | llmnrd.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -236,7 +236,10 @@ int main(int argc, char **argv) goto out; llmnr_init(hostname, ipv6); - iface_init(llmnrd_sock_rtnl, iface, ipv6, &iface_event_handle); + + ret = iface_init(llmnrd_sock_rtnl, iface, ipv6, &iface_event_handle); + if (ret < 0) + goto out; nfds = max(llmnrd_sock_ipv4, llmnrd_sock_rtnl); if (llmnrd_sock_ipv6 >= 0) |