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 <thaller@redhat.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Cong Wang 2014-03-20 10:45:45 -07:00 committed by Thomas Haller
parent 015c4ee59b
commit 67a704676c

View file

@ -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.