diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2014-04-24 00:28:29 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-04-30 09:19:42 (GMT) |
commit | e5d9b828f6ec64fd77854578fbf1c33f214f3ac4 (patch) | |
tree | b2d4e35429fa3147d3c345beb5388a3948acf4de /include/netlink | |
parent | 0ba7e663ce3f6bd624c0b8f4dc27a33cfcb0f5d1 (diff) | |
download | libnl-e5d9b828f6ec64fd77854578fbf1c33f214f3ac4.zip libnl-e5d9b828f6ec64fd77854578fbf1c33f214f3ac4.tar.gz libnl-e5d9b828f6ec64fd77854578fbf1c33f214f3ac4.tar.bz2 |
act: grab a reference when adding an action to a filter
When we add an action to a filter, its lifetime becomes
same with the filter. So in case user frees it before
us, we could just grab a reference here.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include/netlink')
-rw-r--r-- | include/netlink/route/action.h | 1 | ||||
-rw-r--r-- | include/netlink/utils.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/netlink/route/action.h b/include/netlink/route/action.h index e904432..054bdd8 100644 --- a/include/netlink/route/action.h +++ b/include/netlink/route/action.h @@ -22,6 +22,7 @@ extern "C" { #endif extern struct rtnl_act *rtnl_act_alloc(void); +extern void rtnl_act_get(struct rtnl_act *); extern void rtnl_act_put(struct rtnl_act *); extern int rtnl_act_build_add_request(struct rtnl_act *, int, struct nl_msg **); diff --git a/include/netlink/utils.h b/include/netlink/utils.h index 4c2aa19..8faf917 100644 --- a/include/netlink/utils.h +++ b/include/netlink/utils.h @@ -97,6 +97,13 @@ enum { NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE = 2, #define NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE + /** + * rtnl_u32_add_action() and rtnl_basic_add_action() now grab a reference to act + * caller are free to release its own + */ + NL_CAPABILITY_ROUTE_LINK_CLS_ADD_ACT_OWN_REFERENCE = 3, +#define NL_CAPABILITY_ROUTE_LINK_CLS_ADD_ACT_OWN_REFERENCE NL_CAPABILITY_ROUTE_LINK_CLS_ADD_ACT_OWN_REFERENCE + __NL_CAPABILITY_MAX #define NL_CAPABILITY_MAX (__NL_CAPABILITY_MAX - 1) }; |