summaryrefslogtreecommitdiff
path: root/llmnrd.c
diff options
context:
space:
mode:
authorJon Franklin <jvfranklin@gmail.com>2020-03-26 13:22:29 -0500
committerTobias Klauser <tklauser@distanz.ch>2020-03-28 18:41:46 +0100
commit8086a3db780f8a4ee6943a3ef2f774fc78105327 (patch)
tree748e9a4367d3a01679d419f4f08034081c38d21a /llmnrd.c
parentfdf702ec67f8eefbd3ad5bb63f193dce01ef6201 (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/llmnrd.c b/llmnrd.c
index d076484..ba5023c 100644
--- a/llmnrd.c
+++ b/llmnrd.c
@@ -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)