aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-12-08 01:31:36 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-12-27 19:29:45 +0100
commiteae4304000cb72cbb2e422474705ab9b2e38c939 (patch)
tree949d0b92d9836db13ac99f8a6b5a59ec2789bab0 /util.h
parent073f530bfe0b21bb7c94cd047af94f0463dfe96d (diff)
downloadpasst-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>
Diffstat (limited to 'util.h')
-rw-r--r--util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.h b/util.h
index fb8c3f1..d2320f8 100644
--- a/util.h
+++ b/util.h
@@ -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) \