diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2014-04-29 17:38:30 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-04-30 09:08:15 (GMT) |
commit | 0ba7e663ce3f6bd624c0b8f4dc27a33cfcb0f5d1 (patch) | |
tree | 7fecb3bbe188d274d8b281f60fdb60880bc8db15 /include/netlink/utils.h | |
parent | f55ef93d1eb9d792af2a3b79c055ee21bf14e9ea (diff) | |
download | libnl-0ba7e663ce3f6bd624c0b8f4dc27a33cfcb0f5d1.zip libnl-0ba7e663ce3f6bd624c0b8f4dc27a33cfcb0f5d1.tar.gz libnl-0ba7e663ce3f6bd624c0b8f4dc27a33cfcb0f5d1.tar.bz2 |
veth: grab a reference for rtnl_link_veth_get_peer()
So that users could keep a refcount for the peer.
The capability trick is from Thomas Haller.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include/netlink/utils.h')
-rw-r--r-- | include/netlink/utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/netlink/utils.h b/include/netlink/utils.h index 2094bb4..4c2aa19 100644 --- a/include/netlink/utils.h +++ b/include/netlink/utils.h @@ -90,6 +90,13 @@ enum { NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE = 1, #define NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE + /** + * rtnl_link_veth_get_peer() now returns a reference that is owned by the + * caller and must be released by the caller with rtnl_link_put(). + */ + 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 + __NL_CAPABILITY_MAX #define NL_CAPABILITY_MAX (__NL_CAPABILITY_MAX - 1) }; |