summaryrefslogtreecommitdiffstats
path: root/python-ethtool/etherinfo_obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'python-ethtool/etherinfo_obj.c')
-rw-r--r--python-ethtool/etherinfo_obj.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/python-ethtool/etherinfo_obj.c b/python-ethtool/etherinfo_obj.c
index 55a42db..97a06be 100644
--- a/python-ethtool/etherinfo_obj.c
+++ b/python-ethtool/etherinfo_obj.c
@@ -41,7 +41,7 @@ extern PyTypeObject ethtool_etherinfoIPv6Type;
void _ethtool_etherinfo_dealloc(etherinfo_py *self)
{
if( self->data ) {
- close_netlink(self->data);
+ close_netlink(self);
if( self->data->ethinfo ) {
free_etherinfo(self->data->ethinfo);
@@ -151,11 +151,11 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o)
return Py_INCREF(Py_None), Py_None;
}
} else if( strcmp(attr, "mac_address") == 0 ) {
- get_etherinfo(self->data, NLQRY_LINK);
+ get_etherinfo(self, NLQRY_LINK);
Py_INCREF(self->data->ethinfo->hwaddress);
return self->data->ethinfo->hwaddress;
} else if( strcmp(attr, "ipv4_address") == 0 ) {
- get_etherinfo(self->data, NLQRY_ADDR4);
+ get_etherinfo(self, NLQRY_ADDR4);
/* For compatiblity with old approach, return last IPv4 address: */
py_addr = get_last_ipv4_address(self);
if (py_addr) {
@@ -166,14 +166,14 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o)
}
Py_RETURN_NONE;
} else if( strcmp(attr, "ipv4_netmask") == 0 ) {
- get_etherinfo(self->data, NLQRY_ADDR4);
+ get_etherinfo(self, NLQRY_ADDR4);
py_addr = get_last_ipv4_address(self);
if (py_addr) {
return PyInt_FromLong(py_addr->prefixlen);
}
return PyInt_FromLong(0);
} else if( strcmp(attr, "ipv4_broadcast") == 0 ) {
- get_etherinfo(self->data, NLQRY_ADDR4);
+ get_etherinfo(self, NLQRY_ADDR4);
py_addr = get_last_ipv4_address(self);
if (py_addr) {
if (py_addr->ipv4_broadcast) {
@@ -215,14 +215,14 @@ PyObject *_ethtool_etherinfo_str(etherinfo_py *self)
{
PyObject *ret = NULL;
- if( !self || !self->data || !self->data->nlc || !self->data->ethinfo ) {
+ if( !self || !self->data || !self->data->ethinfo ) {
PyErr_SetString(PyExc_AttributeError, "No data available");
return NULL;
}
- get_etherinfo(self->data, NLQRY_LINK);
- get_etherinfo(self->data, NLQRY_ADDR4);
- get_etherinfo(self->data, NLQRY_ADDR6);
+ get_etherinfo(self, NLQRY_LINK);
+ get_etherinfo(self, NLQRY_ADDR4);
+ get_etherinfo(self, NLQRY_ADDR6);
ret = PyString_FromFormat("Device %s:\n", self->data->ethinfo->device);
if( self->data->ethinfo->hwaddress ) {
@@ -281,7 +281,7 @@ static PyObject *_ethtool_etherinfo_get_ipv4_addresses(etherinfo_py *self, PyObj
return NULL;
}
- get_etherinfo(self->data, NLQRY_ADDR4);
+ get_etherinfo(self, NLQRY_ADDR4);
/* Transfer ownership of reference: */
ret = self->data->ethinfo->ipv4_addresses;
@@ -307,7 +307,7 @@ static PyObject *_ethtool_etherinfo_get_ipv6_addresses(etherinfo_py *self, PyObj
return NULL;
}
- get_etherinfo(self->data, NLQRY_ADDR6);
+ get_etherinfo(self, NLQRY_ADDR6);
/* Transfer ownership of reference: */
ret = self->data->ethinfo->ipv6_addresses;