diff options
author | Tom Gundersen <teg@jklm.no> | 2013-10-29 21:20:25 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-10-29 21:26:22 +0100 |
commit | d4bbdb77aff9abb1aaf13f1f92fb5f9513688ce1 (patch) | |
tree | c0a82c9b20e4c88c9df97838da931fa3d93db37f /src/libsystemd-rtnl/test-rtnl.c | |
parent | 897e7561a0f2b0e502fe57081b5d834876c49d7a (diff) |
rtnl: fix sockaddr confusion
Diffstat (limited to 'src/libsystemd-rtnl/test-rtnl.c')
-rw-r--r-- | src/libsystemd-rtnl/test-rtnl.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libsystemd-rtnl/test-rtnl.c b/src/libsystemd-rtnl/test-rtnl.c index 1cdd6e115d..601548b786 100644 --- a/src/libsystemd-rtnl/test-rtnl.c +++ b/src/libsystemd-rtnl/test-rtnl.c @@ -51,7 +51,17 @@ static void test_link_configure(sd_rtnl *rtnl, int ifindex) { assert(type == IFLA_MTU); assert(mtu == *(unsigned int *) data); - assert(sd_rtnl_send_with_reply_and_block(rtnl, message, 2 * USEC_PER_SEC, NULL) == 0); + assert(sd_rtnl_send_with_reply_and_block(rtnl, message, 0, NULL) == 0); +} + +static void test_multiple(void) { + sd_rtnl *rtnl1, *rtnl2; + + assert(sd_rtnl_open(0, &rtnl1) >= 0); + assert(sd_rtnl_open(0, &rtnl2) >= 0); + + rtnl1 = sd_rtnl_unref(rtnl1); + rtnl2 = sd_rtnl_unref(rtnl2); } int main(void) { @@ -64,6 +74,8 @@ int main(void) { unsigned int mtu = 0; unsigned int *mtu_reply; + test_multiple(); + assert(sd_rtnl_open(0, &rtnl) >= 0); assert(rtnl); @@ -80,7 +92,7 @@ int main(void) { assert(sd_rtnl_message_read(m, &type, &data) == 0); - assert(sd_rtnl_send_with_reply_and_block(rtnl, m, 100000000, &r) >= 0); + assert(sd_rtnl_send_with_reply_and_block(rtnl, m, 0, &r) >= 0); assert(sd_rtnl_message_get_type(r, &type) >= 0); assert(type == RTM_NEWLINK); |