The Samba-Bugzilla – Attachment 8593 Details for
Bug 9666
Broken filtering of link-local addresses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for mater.
0001-Fix-bug-9666-Broken-filtering-of-link-local-addresse.patch (text/plain), 2.15 KB, created by
Jeremy Allison
on 2013-02-28 00:28:06 UTC
(
hide
)
Description:
git-am fix for mater.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2013-02-28 00:28:06 UTC
Size:
2.15 KB
patch
obsolete
>From aec0cf6b166e6407a5aca002cc0490a0797852bb Mon Sep 17 00:00:00 2001 >From: Timur Bakeyev <timur@FreeBSD.org> >Date: Wed, 27 Feb 2013 16:25:07 -0800 >Subject: [PATCH] Fix bug # 9666 - Broken filtering of link-local addresses. > >This patch should address the problem with Link Local addresses >on FreeBSD and Linux. > >Reviewed-by: Jeremy Allison <jra@samba.org> >--- > lib/socket/interfaces.c | 31 +++++++++++++++++-------------- > 1 file changed, 17 insertions(+), 14 deletions(-) > >diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c >index 74c6423..336d892 100644 >--- a/lib/socket/interfaces.c >+++ b/lib/socket/interfaces.c >@@ -185,7 +185,22 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) > > memcpy(&ifaces[total].ip, ifptr->ifa_addr, copy_size); > memcpy(&ifaces[total].netmask, ifptr->ifa_netmask, copy_size); >+ /* calculate broadcast address */ >+#if defined(HAVE_IPV6) >+ if (ifptr->ifa_addr->sa_family == AF_INET6) { >+ struct sockaddr_in6 *sin6 = >+ (struct sockaddr_in6 *)ifptr->ifa_addr; >+ struct in6_addr *in6 = >+ (struct in6_addr *)&sin6->sin6_addr; > >+ if (IN6_IS_ADDR_LINKLOCAL(in6) || IN6_IS_ADDR_V4COMPAT(in6)) { >+ sin6->sin6_scope_id = if_nametoindex(ifptr->ifa_name); >+ continue; >+ } >+ /* IPv6 does not have broadcast it uses multicast. */ >+ memset(&ifaces[total].bcast, '\0', copy_size); >+ } else >+#endif > if (ifaces[total].flags & (IFF_BROADCAST|IFF_LOOPBACK)) { > make_bcast(&ifaces[total].bcast, > &ifaces[total].ip, >@@ -195,20 +210,8 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces) > memcpy(&ifaces[total].bcast, > ifptr->ifa_dstaddr, > copy_size); >-#if defined(HAVE_IPV6) >- } else if (ifptr->ifa_addr->sa_family == AF_INET6) { >- const struct sockaddr_in6 *sin6 = >- (const struct sockaddr_in6 *)ifptr->ifa_addr; >- const struct in6_addr *in6 = >- (const struct in6_addr *)&sin6->sin6_addr; >- >- if (IN6_IS_ADDR_LINKLOCAL(in6) || IN6_IS_ADDR_V4COMPAT(in6)) { >- continue; >- } >- /* IPv6 does not have broadcast it uses multicast. */ >- memset(&ifaces[total].bcast, '\0', copy_size); >-#endif >- } else { >+ } >+ else { > continue; > } > >-- >1.8.1.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9666
:
8566
|
8567
|
8568
|
8593
|
8594
|
8598