]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Check for availability of request_update()
authorThomas Graf <tgraf@suug.ch>
Mon, 17 Sep 2007 10:35:19 +0000 (12:35 +0200)
committerThomas Graf <tgraf@suug.ch>
Mon, 17 Sep 2007 10:35:19 +0000 (12:35 +0200)
The implementation of this function is optional if a cache wishes to
be updated by notifications only.

lib/cache.c

index 577b2bae1d033bb449d972632c596e7707fbbe26..c770765c15b83c4a6e84a61ad20266f81f504f21 100644 (file)
@@ -419,6 +419,9 @@ int nl_cache_request_full_dump(struct nl_handle *handle, struct nl_cache *cache)
        NL_DBG(2, "Requesting dump from kernel for cache %p <%s>...\n",
                  cache, nl_cache_name(cache));
 
+       if (cache->c_ops->co_request_update == NULL)
+               return nl_error(EOPNOTSUPP, "Operation not supported");
+
        return cache->c_ops->co_request_update(cache, handle);
 }