diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-15 13:18:50 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-15 13:19:03 +0200 |
commit | db73295accbec0c6513817f0a64a92018592bb26 (patch) | |
tree | 3199040de4a794dc8020c56cab5d8bb8e1155801 /src/libsystemd | |
parent | c22bf27beea56516d8f83784759fb30495e058d7 (diff) |
util: never use ether_ntoa(), since it formats with %x, not %02x, which makes ethernet addresses look funny
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-rtnl/test-rtnl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-rtnl/test-rtnl.c b/src/libsystemd/sd-rtnl/test-rtnl.c index 4b6e5339d9..46b5bb20c3 100644 --- a/src/libsystemd/sd-rtnl/test-rtnl.c +++ b/src/libsystemd/sd-rtnl/test-rtnl.c @@ -34,6 +34,7 @@ static void test_link_configure(sd_rtnl *rtnl, int ifindex) { _cleanup_rtnl_message_unref_ sd_rtnl_message *message; const char *mac = "98:fe:94:3f:c6:18", *name = "test"; + char buffer[ETHER_ADDR_TO_STRING_MAX]; unsigned int mtu = 1450, mtu_out; const char *name_out; struct ether_addr mac_out; @@ -51,7 +52,7 @@ static void test_link_configure(sd_rtnl *rtnl, int ifindex) { assert_se(streq(name, name_out)); assert_se(sd_rtnl_message_read_ether_addr(message, IFLA_ADDRESS, &mac_out) >= 0); - assert_se(streq(mac, ether_ntoa(&mac_out))); + assert_se(streq(mac, ether_addr_to_string(&mac_out, buffer))); assert_se(sd_rtnl_message_read_u32(message, IFLA_MTU, &mtu_out) >= 0); assert_se(mtu == mtu_out); |