From b550b5570acb60aa03f7140b2301362bb6c1051a Mon Sep 17 00:00:00 2001 From: cyrus Date: Thu, 20 Feb 2014 18:43:10 +0000 Subject: [PATCH] mdnsresponder: fix loss of unicast packets (thx Markus Stenberg) git-svn-id: svn://svn.openwrt.org/openwrt/packages@39645 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/mdnsresponder/Makefile | 2 +- ...ckets-to-interface-due-to-link-local.patch | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch diff --git a/net/mdnsresponder/Makefile b/net/mdnsresponder/Makefile index 6e96393b6..1a3d8e68a 100644 --- a/net/mdnsresponder/Makefile +++ b/net/mdnsresponder/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mDNSResponder PKG_VERSION:=544 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/ 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 new file mode 100644 index 000000000..9ae462099 --- /dev/null +++ b/net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch @@ -0,0 +1,44 @@ +From 094714725481da5cfbeaa9e4c713633f3fd0dcc4 Mon Sep 17 00:00:00 2001 +From: Markus Stenberg +Date: Wed, 19 Feb 2014 19:21:40 +0200 +Subject: mdnsresponder: [PATCH] Binding IPv6 sockets to interface + +Due to link-local addresses, otherwise responses may wind up in wrong +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 + +diff --git a/net/mdnsresponder/patches/003-ipv6-bind-to-interface.patch b/net/mdnsresponder/patches/003-ipv6-bind-to-interface.patch +new file mode 100644 +index 0000000..c65221e +--- /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~ +-- +1.7.9.5 +