mdnsresponder: fix binding-patch

git-svn-id: svn://svn.openwrt.org/openwrt/packages@39934 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
cyrus 2014-03-17 14:16:22 +00:00
parent 6af99bf2ad
commit c9f2e1e4d1

View File

@ -9,30 +9,24 @@ places and mdnsd is quite confused.
--- ---
.../patches/003-ipv6-bind-to-interface.patch | 22 ++++++++++++++++++++ .../patches/003-ipv6-bind-to-interface.patch | 22 ++++++++++++++++++++
1 file changed, 22 insertions(+) 1 file changed, 22 insertions(+)
create mode 100644 net/mdnsresponder/patches/003-ipv6-bind-to-interface.patch
--- /dev/null --- mDNSResponder-544.source/mDNSPosix/mDNSPosix.c 2013-12-14 22:54:24.000000000 +0200
+++ b/net/mdnsresponder/patches/003-ipv6-bind-to-interface.patch +++ mDNSResponder-544/mDNSPosix/mDNSPosix.c 2014-02-19 18:59:55.000000000 +0200
@@ -0,0 +1,22 @@ @@ -784,6 +784,17 @@
+diff -ur mDNSResponder-544.source/mDNSPosix/mDNSPosix.c mDNSResponder-544/mDNSPosix/mDNSPosix.c if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); }
+--- 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 @@ +#ifdef __linux__
+ if (err < 0) { err = errno; perror("setsockopt - IPV6_MULTICAST_HOPS"); } +#ifdef SO_BINDTODEVICE
+ } + if (err == 0)
+ + {
++#ifdef __linux__ + char ifname[IFNAMSIZ];
++#ifdef SO_BINDTODEVICE + if (if_indextoname(interfaceIndex, ifname))
++ if (err == 0) + err = setsockopt(*sktPtr, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname));
++ { + }
++ char ifname[IFNAMSIZ]; +#endif /* SO_BINDTODEVICE */
++ if (if_indextoname(interfaceIndex, ifname)) +#endif /* __linux__ */
++ err = setsockopt(*sktPtr, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen(ifname)); +
++ } // And start listening for packets
++#endif /* SO_BINDTODEVICE */ if (err == 0)
++#endif /* __linux__ */ {
++
+ // And start listening for packets
+ if (err == 0)
+ {
+Only in mDNSResponder-544/mDNSPosix: mDNSPosix.c~