From df52c71b4a4af4ba38ef4528638b9bc3ed9ff846 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 15 Apr 2014 12:58:22 +0200 Subject: [PATCH 1/1] fixup! veth: grab a reference for rtnl_link_veth_get_peer() --- include/netlink/utils.h | 7 +++++++ lib/utils.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/netlink/utils.h b/include/netlink/utils.h index 2094bb4..a51f433 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 + NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE = 2 + /** + * rtnl_link_veth_alloc() now returns a reference that is owned by the + * caller and must be released by the caller with rtnl_link_put(). + */ +#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) }; diff --git a/lib/utils.c b/lib/utils.c index 49ff120..ac36493 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -1145,7 +1145,7 @@ int nl_has_capability (int capability) _NL_SETV((i), 3, (v3)) | _NL_SETV((i), 7, (v7)) ) _NL_SET(0, NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE, - 0, + NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE, 0, 0, 0, -- 1.9.0