diff --git a/lib/libnetlink.c b/lib/libnetlink.c index f18dceac..a9932d42 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -656,6 +656,7 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov, if (h->nlmsg_type == NLMSG_ERROR) { struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h); + int error = err->error; if (l < sizeof(struct nlmsgerr)) { fprintf(stderr, "ERROR truncated\n"); @@ -679,7 +680,7 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov, else free(buf); - return err->error ? -i : 0; + return error ? -i : 0; } if (answer) {