summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-neighbor.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-17 19:13:09 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-17 19:13:09 +0200
commita811fb8b377268566704514e2b05d1b9cb98e5ac (patch)
tree1cab778881a740a73bf0d91fc1a3b98e6321b650 /src/network/networkd-neighbor.c
parentnetworkd: use same order in _hash_func() and _compare_func() (diff)
downloadsystemd-a811fb8b377268566704514e2b05d1b9cb98e5ac.tar.xz
systemd-a811fb8b377268566704514e2b05d1b9cb98e5ac.zip
networkd: make neighbor_hash_func() handle the same data as neighbor_compare_func()
In practice this probably makes little difference, because we only use AF_INET and AF_INET6, but it's cleaner to use the same logic in both places.
Diffstat (limited to 'src/network/networkd-neighbor.c')
-rw-r--r--src/network/networkd-neighbor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c
index 537f6be9e1..fd61ebd5d3 100644
--- a/src/network/networkd-neighbor.c
+++ b/src/network/networkd-neighbor.c
@@ -209,18 +209,20 @@ static void neighbor_hash_func(const Neighbor *neighbor, struct siphash *state)
assert(neighbor);
siphash24_compress(&neighbor->family, sizeof(neighbor->family), state);
+ siphash24_compress(&neighbor->lladdr_size, sizeof(neighbor->lladdr_size), state);
switch (neighbor->family) {
case AF_INET:
case AF_INET6:
/* Equality of neighbors are given by the pair (addr,lladdr) */
siphash24_compress(&neighbor->in_addr, FAMILY_ADDRESS_SIZE(neighbor->family), state);
- siphash24_compress(&neighbor->lladdr, neighbor->lladdr_size, state);
break;
default:
/* treat any other address family as AF_UNSPEC */
break;
}
+
+ siphash24_compress(&neighbor->lladdr, neighbor->lladdr_size, state);
}
static int neighbor_compare_func(const Neighbor *a, const Neighbor *b) {