From 6e60a4ef2c05b8679197dfc42d987703dfc15068 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher 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 Reviewed-by: Bjoern Jacke (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 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 Reviewed-by: Bjoern Jacke (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 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 Reviewed-by: Bjoern Jacke Autobuild-User(master): Björn Jacke 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