From 4c301d903dfc3d011e673a8772d4ac75e99bbd2a Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Tue, 17 Dec 2013 21:07:36 +0100 Subject: Reduce the NETLINK pointer complexity Make the NETLINK connection pointer and user counter local global variables inside netlink.c only. Where NETLINK calls via libnl is required, rather use get_nlc() to get a NETLINK connection. This also prepares the next step, to get rid of the struct etherinfo_obj_data wrapper. Signed-off-by: David Sommerseth --- python-ethtool/ethtool.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'python-ethtool/ethtool.c') diff --git a/python-ethtool/ethtool.c b/python-ethtool/ethtool.c index 7e7ff1d..4aa07bc 100644 --- a/python-ethtool/ethtool.c +++ b/python-ethtool/ethtool.c @@ -32,8 +32,6 @@ #include "etherinfo_obj.h" #include "etherinfo.h" -static struct nl_sock *nlconnection = NULL; -unsigned int nlconnection_users = 0; /* How many NETLINK users are active? */ extern PyTypeObject ethtool_etherinfoType; #ifndef IFF_DYNAMIC @@ -292,8 +290,6 @@ static PyObject *get_interfaces_info(PyObject *self __unused, PyObject *args) { */ objdata->ethinfo->device = strdup(fetch_devs[i]); objdata->ethinfo->index = -1; - objdata->nlc = &nlconnection; - objdata->nlc_users = &nlconnection_users; /* Instantiate a new etherinfo object with the device information */ ethinf_py = PyCObject_FromVoidPtr(objdata, NULL); -- cgit