Skip to content

Commit

Permalink
xfrm_user: Propagate netlink error codes properly.
Browse files Browse the repository at this point in the history
Instead of using a fixed value of "-1" or "-EMSGSIZE", propagate what
the nla_*() interfaces actually return.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 28, 2012
1 parent 160c85f commit 1d1e34d
Show file tree
Hide file tree
Showing 2 changed files with 208 additions and 196 deletions.
10 changes: 4 additions & 6 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
if ((m->m | m->v) &&
nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m))
goto nla_put_failure;
return 0;
int ret = 0;

nla_put_failure:
return -1;
if (m->m | m->v)
ret = nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m);
return ret;
}

#endif /* _NET_XFRM_H */
Loading

0 comments on commit 1d1e34d

Please sign in to comment.