Fix the return value for nlmsg_get_error().
This commit is contained in:
parent
ae03b6dd8f
commit
56e30a0923
2
src/nl.h
2
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);
|
const struct nlmsgerr *err = (const struct nlmsgerr *)NLMSG_DATA(nlh);
|
||||||
if (nlh->nlmsg_len < sizeof(struct nlmsgerr) + NLMSG_HDRLEN)
|
if (nlh->nlmsg_len < sizeof(struct nlmsgerr) + NLMSG_HDRLEN)
|
||||||
return EBADMSG;
|
return EBADMSG;
|
||||||
return err->error & 0x7fffffff;
|
return -err->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtattr_assign(struct rtattr *attr, int type, void *data);
|
int rtattr_assign(struct rtattr *attr, int type, void *data);
|
||||||
|
Loading…
Reference in New Issue
Block a user