diff options
author | David Sommerseth <davids@redhat.com> | 2014-05-08 15:00:07 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2014-05-08 15:00:07 +0200 |
commit | 4790675c343b1cf4b8ec9c43e819cd96f31e158c (patch) | |
tree | 12666b99a45ac8933698f9b22c7b590a0dc2f089 | |
parent | c49e4c1a9d36c28acc886793490794e86a955a04 (diff) | |
download | python-ethtool-4790675c343b1cf4b8ec9c43e819cd96f31e158c.tar.gz python-ethtool-4790675c343b1cf4b8ec9c43e819cd96f31e158c.tar.xz python-ethtool-4790675c343b1cf4b8ec9c43e819cd96f31e158c.zip |
Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r-- | python-ethtool/netlink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python-ethtool/netlink.c b/python-ethtool/netlink.c index d311405..bb8534b 100644 --- a/python-ethtool/netlink.c +++ b/python-ethtool/netlink.c @@ -58,7 +58,9 @@ int open_netlink(PyEtherInfo *ethi) /* No earlier connections exists, establish a new one */ nlconnection = nl_socket_alloc(); if( nlconnection != NULL ) { - nl_connect(nlconnection, NETLINK_ROUTE); + if( nl_connect(nlconnection, NETLINK_ROUTE) < 0 ) { + return 0; + } /* Force O_CLOEXEC flag on the NETLINK socket */ if( fcntl(nl_socket_get_fd(nlconnection), F_SETFD, FD_CLOEXEC) == -1 ) { fprintf(stderr, |