summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-03-08 14:35:04 +0100
committerThomas Haller <thaller@redhat.com>2023-03-08 15:34:46 +0100
commitdc5ac4d83c3e4e0cc2f7e87936178969fc624266 (patch)
tree2f0ee60b79c981af81c1e2f6ca413326141e59c3
parent17935511a571ffc9e831b629d25a5b526179f34e (diff)
std-aux/trivial: add code comment to NM_IS_IPv4()
-rw-r--r--src/libnm-std-aux/nm-std-aux.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h
index a5e5abd3d5..a146487eff 100644
--- a/src/libnm-std-aux/nm-std-aux.h
+++ b/src/libnm-std-aux/nm-std-aux.h
@@ -1419,6 +1419,9 @@ nm_utils_addr_family_to_char(int addr_family)
(NM_UNIQ_T(_addr_family, uniq) == NM_AF_INET); \
})
+/* NM_IS_IPv4() is guaranteed to give either 0 or 1! That is an important
+ * guarantee, because we often use that value to index a 2-array (where at
+ * position zero is IPv6 and at position 1 IPv4). */
#define NM_IS_IPv4(addr_family) _NM_IS_IPv4(NM_UNIQ, addr_family)
static inline int