Skip to content

Commit f681c35

Browse files
committed
Return (compatible) integer instead of long type for IPv4 netmask
1 parent 300ba43 commit f681c35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python-ethtool/etherinfo_obj.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ static PyObject *get_ipv4_mask(PyObject *obj, void *info)
248248
addrlist = get_etherinfo_address(self, NLQRY_ADDR4);
249249
py_addr = get_last_ipv4_address(addrlist);
250250
if (py_addr) {
251-
return PyLong_FromLong(py_addr->prefixlen);
251+
return PyInt_FromLong(py_addr->prefixlen);
252252
}
253-
return PyLong_FromLong(0);
253+
return PyInt_FromLong(0);
254254
}
255255

256256
static PyObject *get_ipv4_bcast(PyObject *obj, void *info)

0 commit comments

Comments
 (0)