diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2012-06-01 12:59:24 -0400 |
---|---|---|
committer | Thomas Graf <tgraf@redhat.com> | 2012-06-03 13:52:16 +0200 |
commit | 0c408aad1fc564b53d6382f1076019a7694adff4 (patch) | |
tree | 3a8709d38976556427bd7363fde092952ecd8ccc /tests | |
parent | 43eab4696dc1ce3002238147e2aa099f3a0f7e3a (diff) | |
download | libnl-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.c | 3 |
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"); |