diff --git a/src/net/linux/addrs.c b/src/net/linux/addrs.c index 18a8887f8..c8a904eda 100644 --- a/src/net/linux/addrs.c +++ b/src/net/linux/addrs.c @@ -165,7 +165,7 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg) if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) { err = errno; - DEBUG_WARNING("sendto failed %m\n", err); + DEBUG_WARNING("GETLINK send failed %m\n", err); goto out; } @@ -174,6 +174,12 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg) break; } + if (len < 0) { + err = errno; + DEBUG_WARNING("GETLINK recv failed %m\n", err); + goto out; + } + /* GETADDR */ memset(&req, 0, sizeof(req)); req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); @@ -182,7 +188,7 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg) if (send(sock, &req, req.nlh.nlmsg_len, 0) < 0) { err = errno; - DEBUG_WARNING("sendto failed %m\n", err); + DEBUG_WARNING("GETADDR send failed %m\n", err); goto out; } @@ -192,6 +198,11 @@ int net_netlink_addrs(net_ifaddr_h *ifh, void *arg) break; } + if (len < 0) { + err = errno; + DEBUG_WARNING("GETADDR recv failed %m\n", err); + } + out: close(sock);