packages/net/mdnsresponder/patches/100-Binding-IPv6-sockets-to-interface-due-to-link-local.patch
florian 0918445fde mdnsresponder: ensure dns-sd is linked with the right options
Some toolchains (e.g: ARM with VFP) require us to specify the ABI to use,
update the dns-sd linking command-line for this.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@39811 3c298f89-4303-0410-b956-a3cf2f4a3e73
2014-03-08 00:57:04 +00:00

39 lines
1.5 KiB
Diff

From 094714725481da5cfbeaa9e4c713633f3fd0dcc4 Mon Sep 17 00:00:00 2001
From: Markus Stenberg <markus.stenberg@iki.fi>
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
--- /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~