diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-12-08 01:31:36 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-12-27 19:29:45 +0100 |
commit | eae4304000cb72cbb2e422474705ab9b2e38c939 (patch) | |
tree | 949d0b92d9836db13ac99f8a6b5a59ec2789bab0 | |
parent | 073f530bfe0b21bb7c94cd047af94f0463dfe96d (diff) | |
download | passt-eae4304000cb72cbb2e422474705ab9b2e38c939.tar passt-eae4304000cb72cbb2e422474705ab9b2e38c939.tar.gz passt-eae4304000cb72cbb2e422474705ab9b2e38c939.tar.bz2 passt-eae4304000cb72cbb2e422474705ab9b2e38c939.tar.lz passt-eae4304000cb72cbb2e422474705ab9b2e38c939.tar.xz passt-eae4304000cb72cbb2e422474705ab9b2e38c939.tar.zst passt-eae4304000cb72cbb2e422474705ab9b2e38c939.zip |
util: Use htonl_constant() in more places
We might as well when we're passing a known constant value, giving the
compiler the best chance to optimise things away.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | util.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -111,9 +111,9 @@ #endif #define IN4_IS_ADDR_UNSPECIFIED(a) \ - ((a)->s_addr == htonl(INADDR_ANY)) + ((a)->s_addr == htonl_constant(INADDR_ANY)) #define IN4_IS_ADDR_BROADCAST(a) \ - ((a)->s_addr == htonl(INADDR_BROADCAST)) + ((a)->s_addr == htonl_constant(INADDR_BROADCAST)) #define IN4_IS_ADDR_LOOPBACK(a) \ (ntohl((a)->s_addr) >> IN_CLASSA_NSHIFT == IN_LOOPBACKNET) #define IN4_IS_ADDR_MULTICAST(a) \ |