From af70728b51d88717c571ebf3d5886006e34db57f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 25 Feb 2010 16:29:47 +1100 Subject: pyglue: don't return 127.0.0.0/8 IPs in interface_ips() We don't generally want loopback addresses in the python code --- source4/scripting/python/pyglue.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'source4/scripting/python/pyglue.c') diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index f072386791..3ae0a0965c 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -491,6 +491,8 @@ static PyObject *py_dsdb_load_partition_usn(PyObject *self, PyObject *args) /* return the list of interface IPs we have configured takes an loadparm context, returns a list of IPs in string form + + Does not return addresses on 127.0.0.0/8 */ static PyObject *py_interface_ips(PyObject *self, PyObject *args) { @@ -500,7 +502,7 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args) PyObject *py_lp_ctx; struct loadparm_context *lp_ctx; struct interface *ifaces; - int i; + int i, ifcount; if (!PyArg_ParseTuple(args, "O", &py_lp_ctx)) return NULL; @@ -517,10 +519,21 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args) count = iface_count(ifaces); - pylist = PyList_New(count); - for (i = 0; i