diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-15 01:26:01 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2016-06-15 01:26:01 +0200 |
commit | 8e38570ebed346c00e58c3fcc998a4b305e83a36 (patch) | |
tree | e1c56e0c9b1ff621fb53cd98f48649f3fd999119 /src/test | |
parent | 69281c49eb824b2cc854fdb5b97f134b1371be8d (diff) |
tree-wide: htonl() is weird, let's use htobe32() instead (#3538)
Super-important change, yeah!
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-nss.c | 4 | ||||
-rw-r--r-- | src/test/test-socket-util.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/test/test-nss.c b/src/test/test-nss.c index 55af592287..c43bda5917 100644 --- a/src/test/test-nss.c +++ b/src/test/test-nss.c @@ -400,8 +400,8 @@ int main(int argc, char **argv) { _cleanup_free_ char *dir = NULL, *hostname = NULL; const char *module; - const uint32_t local_address_ipv4 = htonl(0x7F000001); - const uint32_t local_address_ipv4_2 = htonl(0x7F000002); + const uint32_t local_address_ipv4 = htobe32(0x7F000001); + const uint32_t local_address_ipv4_2 = htobe32(0x7F000002); _cleanup_free_ struct local_address *addresses = NULL; int n_addresses; diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index 1a439bd0d4..1f853a7f16 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -353,7 +353,7 @@ static void test_nameinfo_pretty(void) { union sockaddr_union s = { .in.sin_family = AF_INET, .in.sin_port = 0, - .in.sin_addr.s_addr = htonl(INADDR_ANY), + .in.sin_addr.s_addr = htobe32(INADDR_ANY), }; int r; @@ -391,17 +391,17 @@ static void test_sockaddr_equal(void) { union sockaddr_union a = { .in.sin_family = AF_INET, .in.sin_port = 0, - .in.sin_addr.s_addr = htonl(INADDR_ANY), + .in.sin_addr.s_addr = htobe32(INADDR_ANY), }; union sockaddr_union b = { .in.sin_family = AF_INET, .in.sin_port = 0, - .in.sin_addr.s_addr = htonl(INADDR_ANY), + .in.sin_addr.s_addr = htobe32(INADDR_ANY), }; union sockaddr_union c = { .in.sin_family = AF_INET, .in.sin_port = 0, - .in.sin_addr.s_addr = htonl(1234), + .in.sin_addr.s_addr = htobe32(1234), }; union sockaddr_union d = { .in6.sin6_family = AF_INET6, |