diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 21:04:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:45 -0400 |
commit | e545d71390b50a8dab75efb182a4adc3c2603962 (patch) | |
tree | efc33986581ccdd5b28d06aab81997717d278ea9 /include/net/xfrm.h | |
parent | 9d83ba4b6c6625de038f03cee18dd7bd89cee69b (diff) |
xfrm: Stop using NLA_PUT*().
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 96239e78e621..1cb32bf107de 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1682,8 +1682,9 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) | |||
1682 | 1682 | ||
1683 | static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) | 1683 | static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) |
1684 | { | 1684 | { |
1685 | if (m->m | m->v) | 1685 | if ((m->m | m->v) && |
1686 | NLA_PUT(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m); | 1686 | nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m)) |
1687 | goto nla_put_failure; | ||
1687 | return 0; | 1688 | return 0; |
1688 | 1689 | ||
1689 | nla_put_failure: | 1690 | nla_put_failure: |