Commit 1d1e34dd authored by David S. Miller's avatar David S. Miller

xfrm_user: Propagate netlink error codes properly.

Instead of using a fixed value of "-1" or "-EMSGSIZE", propagate what
the nla_*() interfaces actually return.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 160c85f0
...@@ -1682,13 +1682,11 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) ...@@ -1682,13 +1682,11 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m)
{ {
if ((m->m | m->v) && int ret = 0;
nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m))
goto nla_put_failure;
return 0;
nla_put_failure: if (m->m | m->v)
return -1; ret = nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m);
return ret;
} }
#endif /* _NET_XFRM_H */ #endif /* _NET_XFRM_H */
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment