The Samba-Bugzilla – Attachment 9181 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.0
patch-bug-10030-samba4.0.patch (text/plain), 4.94 KB, created by
Björn Jacke
on 2013-08-31 19:40:37 UTC
(
hide
)
Description:
patch for 4.0
Filename:
MIME Type:
Creator:
Björn Jacke
Created:
2013-08-31 19:40:37 UTC
Size:
4.94 KB
patch
obsolete
>From 6e60a4ef2c05b8679197dfc42d987703dfc15068 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 c21de46..802153a 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 d9dac1dbb537403fc831f27a83806d381632383e 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 c07dbcae3eaede9e18ad032b6435c2b77617ee3c 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 f13b7d1..e0b3d22 100644 >--- a/python/samba/provision/__init__.py >+++ b/python/samba/provision/__init__.py >@@ -1695,12 +1695,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 > >@@ -1997,7 +1997,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