diff --git a/src/nl.h b/src/nl.h index fa07528..640625d 100644 --- a/src/nl.h +++ b/src/nl.h @@ -38,7 +38,7 @@ static inline int nlmsg_get_error(const struct nlmsghdr *nlh) const struct nlmsgerr *err = (const struct nlmsgerr *)NLMSG_DATA(nlh); if (nlh->nlmsg_len < sizeof(struct nlmsgerr) + NLMSG_HDRLEN) return EBADMSG; - return err->error & 0x7fffffff; + return -err->error; } int rtattr_assign(struct rtattr *attr, int type, void *data);