@@ -41,7 +41,7 @@ extern PyTypeObject ethtool_etherinfoIPv6Type;
4141void _ethtool_etherinfo_dealloc (etherinfo_py * self )
4242{
4343 if ( self -> data ) {
44- close_netlink (self -> data );
44+ close_netlink (self );
4545
4646 if ( self -> data -> ethinfo ) {
4747 free_etherinfo (self -> data -> ethinfo );
@@ -151,11 +151,11 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o)
151151 return Py_INCREF (Py_None ), Py_None ;
152152 }
153153 } else if ( strcmp (attr , "mac_address" ) == 0 ) {
154- get_etherinfo (self -> data , NLQRY_LINK );
154+ get_etherinfo (self , NLQRY_LINK );
155155 Py_INCREF (self -> data -> ethinfo -> hwaddress );
156156 return self -> data -> ethinfo -> hwaddress ;
157157 } else if ( strcmp (attr , "ipv4_address" ) == 0 ) {
158- get_etherinfo (self -> data , NLQRY_ADDR4 );
158+ get_etherinfo (self , NLQRY_ADDR4 );
159159 /* For compatiblity with old approach, return last IPv4 address: */
160160 py_addr = get_last_ipv4_address (self );
161161 if (py_addr ) {
@@ -166,14 +166,14 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o)
166166 }
167167 Py_RETURN_NONE ;
168168 } else if ( strcmp (attr , "ipv4_netmask" ) == 0 ) {
169- get_etherinfo (self -> data , NLQRY_ADDR4 );
169+ get_etherinfo (self , NLQRY_ADDR4 );
170170 py_addr = get_last_ipv4_address (self );
171171 if (py_addr ) {
172172 return PyInt_FromLong (py_addr -> prefixlen );
173173 }
174174 return PyInt_FromLong (0 );
175175 } else if ( strcmp (attr , "ipv4_broadcast" ) == 0 ) {
176- get_etherinfo (self -> data , NLQRY_ADDR4 );
176+ get_etherinfo (self , NLQRY_ADDR4 );
177177 py_addr = get_last_ipv4_address (self );
178178 if (py_addr ) {
179179 if (py_addr -> ipv4_broadcast ) {
@@ -215,14 +215,14 @@ PyObject *_ethtool_etherinfo_str(etherinfo_py *self)
215215{
216216 PyObject * ret = NULL ;
217217
218- if ( !self || !self -> data || !self -> data -> nlc || ! self -> data -> ethinfo ) {
218+ if ( !self || !self -> data || !self -> data -> ethinfo ) {
219219 PyErr_SetString (PyExc_AttributeError , "No data available" );
220220 return NULL ;
221221 }
222222
223- get_etherinfo (self -> data , NLQRY_LINK );
224- get_etherinfo (self -> data , NLQRY_ADDR4 );
225- get_etherinfo (self -> data , NLQRY_ADDR6 );
223+ get_etherinfo (self , NLQRY_LINK );
224+ get_etherinfo (self , NLQRY_ADDR4 );
225+ get_etherinfo (self , NLQRY_ADDR6 );
226226
227227 ret = PyString_FromFormat ("Device %s:\n" , self -> data -> ethinfo -> device );
228228 if ( self -> data -> ethinfo -> hwaddress ) {
@@ -281,7 +281,7 @@ static PyObject *_ethtool_etherinfo_get_ipv4_addresses(etherinfo_py *self, PyObj
281281 return NULL ;
282282 }
283283
284- get_etherinfo (self -> data , NLQRY_ADDR4 );
284+ get_etherinfo (self , NLQRY_ADDR4 );
285285
286286 /* Transfer ownership of reference: */
287287 ret = self -> data -> ethinfo -> ipv4_addresses ;
@@ -307,7 +307,7 @@ static PyObject *_ethtool_etherinfo_get_ipv6_addresses(etherinfo_py *self, PyObj
307307 return NULL ;
308308 }
309309
310- get_etherinfo (self -> data , NLQRY_ADDR6 );
310+ get_etherinfo (self , NLQRY_ADDR6 );
311311
312312 /* Transfer ownership of reference: */
313313 ret = self -> data -> ethinfo -> ipv6_addresses ;
0 commit comments