From 3ab81527cf173e2e85880de54c7184b0489c1c0e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 17 Mar 2014 14:16:22 +0000 Subject: [PATCH] mdnsresponder: fix binding-patch SVN-Revision: 39934 --- ...ckets-to-interface-due-to-link-local.patch | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch b/net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch index 639a186fb0..ebac1116f1 100644 --- a/net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch +++ b/net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch @@ -9,30 +9,24 @@ places and mdnsd is quite confused. --- .../patches/003-ipv6-bind-to-interface.patch | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) - create mode 100644 net/mdnsresponder/patches/003-ipv6-bind-to-interface.patch ---- /dev/null -+++ b/net/mdnsresponder/patches/003-ipv6-bind-to-interface.patch -@@ -0,0 +1,22 @@ -+diff -ur mDNSResponder-544.source/mDNSPosix/mDNSPosix.c mDNSResponder-544/mDNSPosix/mDNSPosix.c -+--- mDNSResponder-544.source/mDNSPosix/mDNSPosix.c 2013-12-14 22:54:24.000000000 +0200 -++++ mDNSResponder-544/mDNSPosix/mDNSPosix.c 2014-02-19 18:59:55.000000000 +0200 -+@@ -784,6 +784,17 @@ -+ if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); } -+ } -+ -++#ifdef __linux__ -++#ifdef SO_BINDTODEVICE -++ if (err == 0) -++ { -++ char ifname[IFNAMSIZ]; -++ if (if_indextoname(interfaceIndex, ifname)) -++ err = setsockopt(*sktPtr, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname)); -++ } -++#endif /* SO_BINDTODEVICE */ -++#endif /* __linux__ */ -++ -+ // And start listening for packets -+ if (err == 0) -+ { -+Only in mDNSResponder-544/mDNSPosix: mDNSPosix.c~ +--- mDNSResponder-544.source/mDNSPosix/mDNSPosix.c 2013-12-14 22:54:24.000000000 +0200 ++++ mDNSResponder-544/mDNSPosix/mDNSPosix.c 2014-02-19 18:59:55.000000000 +0200 +@@ -784,6 +784,17 @@ + if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); } + } + ++#ifdef __linux__ ++#ifdef SO_BINDTODEVICE ++ if (err == 0) ++ { ++ char ifname[IFNAMSIZ]; ++ if (if_indextoname(interfaceIndex, ifname)) ++ err = setsockopt(*sktPtr, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname)); ++ } ++#endif /* SO_BINDTODEVICE */ ++#endif /* __linux__ */ ++ + // And start listening for packets + if (err == 0) + { -- 2.30.2