diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2014-03-20 17:45:45 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-03-20 18:37:37 (GMT) |
commit | 67a704676c9ccc153f87aa86cd0a444f42608162 (patch) | |
tree | 946fbbc0bb5e8b7bdee338412a63b7b9fc177148 | |
parent | 015c4ee59b786fec35118c2a963532b3e05ba5a2 (diff) | |
download | libnl-67a704676c9ccc153f87aa86cd0a444f42608162.zip libnl-67a704676c9ccc153f87aa86cd0a444f42608162.tar.gz libnl-67a704676c9ccc153f87aa86cd0a444f42608162.tar.bz2 |
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>
-rw-r--r-- | lib/route/link.c | 11 |
1 files 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. |