The Samba-Bugzilla – Attachment 9180 Details for
Bug 10030
::1 added to nameserver on join
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.1
patch-bug-10030.patch (text/plain), 4.94 KB, created by
Björn Jacke
on 2013-08-31 19:35:18 UTC
(
hide
)
Description:
patch for 4.1
Filename:
MIME Type:
Creator:
Björn Jacke
Created:
2013-08-31 19:35:18 UTC
Size:
4.94 KB
patch
obsolete
>From 383fcd29cc0a62dec84c88344c4b580bc6c8b096 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 30 Aug 2013 14:59:01 +0200 >Subject: [PATCH 1/3] python/pyglue: filter out loopback and linklocal > addresses unless all_interfaces is given > >Bug: https://bugzilla.samba.org/show_bug.cgi?id=10030 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Bjoern Jacke <bj@sernet.de> >(cherry picked from commit 0e6aca40413fb3cfd4300f282204a69743be4a65) >--- > python/pyglue.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 43 insertions(+), 2 deletions(-) > >diff --git a/python/pyglue.c b/python/pyglue.c >index 735f03a..02fb005 100644 >--- a/python/pyglue.c >+++ b/python/pyglue.c >@@ -164,18 +164,59 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args) > /* first count how many are not loopback addresses */ > for (ifcount = i = 0; i<count; i++) { > const char *ip = iface_list_n_ip(ifaces, i); >- if (!(!all_interfaces && iface_list_same_net(ip, "127.0.0.1", "255.0.0.0"))) { >+ >+ if (all_interfaces) { > ifcount++; >+ continue; >+ } >+ >+ if (iface_list_same_net(ip, "127.0.0.1", "255.0.0.0")) { >+ continue; >+ } >+ >+ if (iface_list_same_net(ip, "169.254.0.0", "255.255.0.0")) { >+ continue; > } >+ >+ if (iface_list_same_net(ip, "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")) { >+ continue; >+ } >+ >+ if (iface_list_same_net(ip, "fe80::", "ffff:ffff:ffff:ffff::")) { >+ continue; >+ } >+ >+ ifcount++; > } > > pylist = PyList_New(ifcount); > for (ifcount = i = 0; i<count; i++) { > const char *ip = iface_list_n_ip(ifaces, i); >- if (!(!all_interfaces && iface_list_same_net(ip, "127.0.0.1", "255.0.0.0"))) { >+ >+ if (all_interfaces) { > PyList_SetItem(pylist, ifcount, PyString_FromString(ip)); > ifcount++; >+ continue; >+ } >+ >+ if (iface_list_same_net(ip, "127.0.0.1", "255.0.0.0")) { >+ continue; >+ } >+ >+ if (iface_list_same_net(ip, "169.254.0.0", "255.255.0.0")) { >+ continue; > } >+ >+ if (iface_list_same_net(ip, "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")) { >+ continue; >+ } >+ >+ if (iface_list_same_net(ip, "fe80::", "ffff:ffff:ffff:ffff::")) { >+ continue; >+ } >+ >+ PyList_SetItem(pylist, ifcount, PyString_FromString(ip)); >+ ifcount++; > } > talloc_free(tmp_ctx); > return pylist; >-- >1.8.3.4 > > >From 0a4ed8d0019bcb005bc8331f6d4e56909555b28d Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 30 Aug 2013 15:17:59 +0200 >Subject: [PATCH 2/3] s4:samba_upgradedns: don't pass linklocal=False to > interface_ips_v6() > >This is the default... > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Bjoern Jacke <bj@sernet.de> >(cherry picked from commit 9edc0276c742194ec381c266acedf3216ccf1c69) >--- > source4/scripting/bin/samba_upgradedns | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source4/scripting/bin/samba_upgradedns b/source4/scripting/bin/samba_upgradedns >index 3c30090..b7af98c 100755 >--- a/source4/scripting/bin/samba_upgradedns >+++ b/source4/scripting/bin/samba_upgradedns >@@ -331,7 +331,7 @@ if __name__ == '__main__': > logger.debug("IPv4 addresses: %s" % hostip) > > logger.info("Looking up IPv6 addresses") >- hostip6 = interface_ips_v6(lp, linklocal=False) >+ hostip6 = interface_ips_v6(lp) > if not hostip6: > hostip6 = None > else: >-- >1.8.3.4 > > >From 9c9050cb2896a3faec4b34741c05d2337fc910d9 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 30 Aug 2013 15:18:44 +0200 >Subject: [PATCH 3/3] python/provision: remove unused linklocal=False argument > from interface_ips_v6() >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Bjoern Jacke <bj@sernet.de> > >Autobuild-User(master): Björn Jacke <bj@sernet.de> >Autobuild-Date(master): Fri Aug 30 17:33:58 CEST 2013 on sn-devel-104 > >(cherry picked from commit 3430448fc01ce3fbe0606a2c239d3c98a5b78361) >--- > python/samba/provision/__init__.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py >index a84b92f..89f029a 100644 >--- a/python/samba/provision/__init__.py >+++ b/python/samba/provision/__init__.py >@@ -1705,12 +1705,12 @@ def interface_ips_v4(lp): > return ret > > >-def interface_ips_v6(lp, linklocal=False): >+def interface_ips_v6(lp): > """return only IPv6 IPs""" > ips = samba.interface_ips(lp, False) > ret = [] > for i in ips: >- if i.find(':') != -1 and (linklocal or i.find('%') == -1): >+ if i.find(':') != -1: > ret.append(i) > return ret > >@@ -2007,7 +2007,7 @@ def provision(logger, session_info, credentials, smbconf=None, > > if hostip6 is None: > logger.info("Looking up IPv6 addresses") >- hostips = interface_ips_v6(lp, linklocal=False) >+ hostips = interface_ips_v6(lp) > if hostips: > hostip6 = hostips[0] > if len(hostips) > 1: >-- >1.8.3.4 >
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
Flags:
bjacke
:
review+
metze
:
review+
Actions:
View
Attachments on
bug 10030
:
9056
| 9180 |
9181