From 8086a3db780f8a4ee6943a3ef2f774fc78105327 Mon Sep 17 00:00:00 2001 From: Jon Franklin Date: Thu, 26 Mar 2020 13:22:29 -0500 Subject: 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 [tk: small adjustments to commit message, check return value of iface_init] Signed-off-by: Tobias Klauser --- llmnrd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llmnrd.c') 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) -- cgit v1.2.3-54-g00ecf