summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2012-06-01 12:59:24 -0400
committerThomas Graf <tgraf@redhat.com>2012-06-03 13:52:16 +0200
commit0c408aad1fc564b53d6382f1076019a7694adff4 (patch)
tree3a8709d38976556427bd7363fde092952ecd8ccc /tests
parent43eab4696dc1ce3002238147e2aa099f3a0f7e3a (diff)
downloadlibnl-0c408aad1fc564b53d6382f1076019a7694adff4.tar.gz
genl: modify genl_ctrl_resolve and friends to allow for module auto-loading
Generic netlink has the ability to autoload modules in response to a request for a family. Currently libnl uses a GETFAMILY call with the NLM_F_DUMP flag to list all the available families, but doing so neglects the possibility of an autoloaded module. This patch modifies the genl code to probe the kernel for a specific family rather than dumping a list of all the currenlty available ones, making autoload work properly. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Thomas Graf <tgraf@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-genl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test-genl.c b/tests/test-genl.c
index 63862b3..74aea10 100644
--- a/tests/test-genl.c
+++ b/tests/test-genl.c
@@ -84,6 +84,9 @@ int main(int argc, char *argv[])
if ((err = genl_ops_resolve(sock, &ops)) < 0)
nl_cli_fatal(err, "Unable to resolve family name");
+ if (genl_ctrl_resolve(sock, "nlctrl") != GENL_ID_CTRL)
+ nl_cli_fatal(NLE_INVAL, "Resolving of \"nlctrl\" failed");
+
msg = nlmsg_alloc();
if (msg == NULL)
nl_cli_fatal(NLE_NOMEM, "Unable to allocate netlink message");