summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-neighbor.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-12-24 09:51:30 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-12-25 07:38:59 +0100
commitc01a5c0527b7c49d4b10f5d525de060feb2b37f2 (patch)
tree9831d585e249cbcb21ccb24194e93e48dfff3aab /src/network/networkd-neighbor.c
parentresolve: don't add sockets to the graveyard on shutdown (diff)
downloadsystemd-c01a5c0527b7c49d4b10f5d525de060feb2b37f2.tar.xz
systemd-c01a5c0527b7c49d4b10f5d525de060feb2b37f2.zip
siphash24: introduce siphash24_compress_typesafe() macro
To prevent copy-and-paste mistake. This also introduce in_addr_hash_func(). No functional change, just refactoring.
Diffstat (limited to 'src/network/networkd-neighbor.c')
-rw-r--r--src/network/networkd-neighbor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c
index b9c7875bc4..e172c564b0 100644
--- a/src/network/networkd-neighbor.c
+++ b/src/network/networkd-neighbor.c
@@ -90,7 +90,7 @@ static int neighbor_dup(const Neighbor *neighbor, Neighbor **ret) {
static void neighbor_hash_func(const Neighbor *neighbor, struct siphash *state) {
assert(neighbor);
- siphash24_compress(&neighbor->family, sizeof(neighbor->family), state);
+ siphash24_compress_typesafe(neighbor->family, state);
if (!IN_SET(neighbor->family, AF_INET, AF_INET6))
/* treat any other address family as AF_UNSPEC */
@@ -98,7 +98,7 @@ static void neighbor_hash_func(const Neighbor *neighbor, struct siphash *state)
/* Equality of neighbors are given by the destination address.
* See neigh_lookup() in the kernel. */
- siphash24_compress(&neighbor->in_addr, FAMILY_ADDRESS_SIZE(neighbor->family), state);
+ in_addr_hash_func(&neighbor->in_addr, neighbor->family, state);
}
static int neighbor_compare_func(const Neighbor *a, const Neighbor *b) {