diff options
author | David Sommerseth <davids@redhat.com> | 2013-12-20 00:18:56 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2013-12-20 00:20:16 +0100 |
commit | 52b17fc36d39c32d6e766c18ee8fd4f472f62d39 (patch) | |
tree | fc51b65fa6927cba0e34c6966f4e87394645146c /python-ethtool/etherinfo_obj.c | |
parent | d8b7393db11aec4e0e332dd1dfb6dc6f34888206 (diff) | |
download | python-ethtool-52b17fc36d39c32d6e766c18ee8fd4f472f62d39.tar.gz python-ethtool-52b17fc36d39c32d6e766c18ee8fd4f472f62d39.tar.xz python-ethtool-52b17fc36d39c32d6e766c18ee8fd4f472f62d39.zip |
Clean-up get_etherinfo() and move it to get_etherinfo_address()
This follows the previous commit. Just cleaning up and
making things a bit more clearer.
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'python-ethtool/etherinfo_obj.c')
-rw-r--r-- | python-ethtool/etherinfo_obj.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python-ethtool/etherinfo_obj.c b/python-ethtool/etherinfo_obj.c index 8e3da62..4ac42a0 100644 --- a/python-ethtool/etherinfo_obj.c +++ b/python-ethtool/etherinfo_obj.c @@ -151,7 +151,7 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o) Py_INCREF(self->ethinfo->hwaddress); return self->ethinfo->hwaddress; } else if( strcmp(attr, "ipv4_address") == 0 ) { - get_etherinfo(self, NLQRY_ADDR4); + get_etherinfo_address(self, NLQRY_ADDR4); /* For compatiblity with old approach, return last IPv4 address: */ py_addr = get_last_ipv4_address(self); if (py_addr) { @@ -162,14 +162,14 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o) } Py_RETURN_NONE; } else if( strcmp(attr, "ipv4_netmask") == 0 ) { - get_etherinfo(self, NLQRY_ADDR4); + get_etherinfo_address(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, NLQRY_ADDR4); + get_etherinfo_address(self, NLQRY_ADDR4); py_addr = get_last_ipv4_address(self); if (py_addr) { if (py_addr->ipv4_broadcast) { @@ -217,8 +217,8 @@ PyObject *_ethtool_etherinfo_str(etherinfo_py *self) } get_etherinfo_link(self); - get_etherinfo(self, NLQRY_ADDR4); - get_etherinfo(self, NLQRY_ADDR6); + get_etherinfo_address(self, NLQRY_ADDR4); + get_etherinfo_address(self, NLQRY_ADDR6); ret = PyString_FromFormat("Device %s:\n", self->ethinfo->device); if( self->ethinfo->hwaddress ) { @@ -277,7 +277,7 @@ static PyObject *_ethtool_etherinfo_get_ipv4_addresses(etherinfo_py *self, PyObj return NULL; } - get_etherinfo(self, NLQRY_ADDR4); + get_etherinfo_address(self, NLQRY_ADDR4); /* Transfer ownership of reference: */ ret = self->ethinfo->ipv4_addresses; @@ -303,7 +303,7 @@ static PyObject *_ethtool_etherinfo_get_ipv6_addresses(etherinfo_py *self, PyObj return NULL; } - get_etherinfo(self, NLQRY_ADDR6); + get_etherinfo_address(self, NLQRY_ADDR6); /* Transfer ownership of reference: */ ret = self->ethinfo->ipv6_addresses; |