From 67a704676c9ccc153f87aa86cd0a444f42608162 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Thu, 20 Mar 2014 10:45:45 -0700 Subject: [PATCH] link: document sk == NULL case for rtnl_link_alloc_cache() When sk == NULL, rtnl_link_alloc_cache() returns 0 but the cache is still empty. We should document this behavior, otherwise it is confusing. Cc: Thomas Haller Cc: Thomas Graf Signed-off-by: Cong Wang Signed-off-by: Thomas Haller --- lib/route/link.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/route/link.c b/lib/route/link.c index 9979b5b..fa26b5f 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -997,11 +997,12 @@ static char *link_attrs2str(int attrs, char *buf, size_t len) * @arg family Link address family or AF_UNSPEC * @arg result Pointer to store resulting cache. * - * Allocates and initializes a new link cache. A netlink message is sent to - * the kernel requesting a full dump of all configured links. The returned - * messages are parsed and filled into the cache. If the operation succeeds - * the resulting cache will a link object for each link configured in the - * kernel. + * Allocates and initializes a new link cache. If \c sk is valid, a netlink + * message is sent to the kernel requesting a full dump of all configured + * links. The returned messages are parsed and filled into the cache. If + * the operation succeeds, the resulting cache will contain a link object for + * each link configured in the kernel. If \c sk is NULL, returns 0 but the + * cache is still empty. * * If \c family is set to an address family other than \c AF_UNSPEC the * contents of the cache can be limited to a specific address family. -- 2.40.0