Fix the return value for nlmsg_get_error().

This commit is contained in:
Nicholas J. Kain 2014-06-13 22:35:57 -04:00
parent ae03b6dd8f
commit 56e30a0923

View File

@ -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);