aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 23f27b0b3cef..1f18b47f41b4 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -1415,13 +1415,18 @@ static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp)
1415} 1415}
1416 1416
1417/** 1417/**
1418 * nla_nest_start - Start a new level of nested attributes 1418 * nla_nest_start_noflag - Start a new level of nested attributes
1419 * @skb: socket buffer to add attributes to 1419 * @skb: socket buffer to add attributes to
1420 * @attrtype: attribute type of container 1420 * @attrtype: attribute type of container
1421 * 1421 *
1422 * Returns the container attribute 1422 * This function exists for backward compatibility to use in APIs which never
1423 * marked their nest attributes with NLA_F_NESTED flag. New APIs should use
1424 * nla_nest_start() which sets the flag.
1425 *
1426 * Returns the container attribute or NULL on error
1423 */ 1427 */
1424static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype) 1428static inline struct nlattr *nla_nest_start_noflag(struct sk_buff *skb,
1429 int attrtype)
1425{ 1430{
1426 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb); 1431 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb);
1427 1432
@@ -1432,6 +1437,21 @@ static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype)
1432} 1437}
1433 1438
1434/** 1439/**
1440 * nla_nest_start - Start a new level of nested attributes, with NLA_F_NESTED
1441 * @skb: socket buffer to add attributes to
1442 * @attrtype: attribute type of container
1443 *
1444 * Unlike nla_nest_start_noflag(), mark the nest attribute with NLA_F_NESTED
1445 * flag. This is the preferred function to use in new code.
1446 *
1447 * Returns the container attribute or NULL on error
1448 */
1449static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype)
1450{
1451 return nla_nest_start_noflag(skb, attrtype | NLA_F_NESTED);
1452}
1453
1454/**
1435 * nla_nest_end - Finalize nesting of attributes 1455 * nla_nest_end - Finalize nesting of attributes
1436 * @skb: socket buffer the attributes are stored in 1456 * @skb: socket buffer the attributes are stored in
1437 * @start: container attribute 1457 * @start: container attribute