From 00d75e5752f68a7b5d066158fdf0adffcaa9a7f2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 4 Dec 2014 04:16:29 +0100 Subject: [PATCH] rtnl: order local addresses/gateways by the address itself as last resort This way we can be sure that the returned list is stable regarding modifications in the kernel. --- src/libsystemd/sd-rtnl/local-addresses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd/sd-rtnl/local-addresses.c b/src/libsystemd/sd-rtnl/local-addresses.c index 629f89697..e520cdfa6 100644 --- a/src/libsystemd/sd-rtnl/local-addresses.c +++ b/src/libsystemd/sd-rtnl/local-addresses.c @@ -50,7 +50,7 @@ static int address_compare(const void *_a, const void *_b) { if (a->ifindex > b->ifindex) return 1; - return 0; + return memcmp(&a->address, &b->address, FAMILY_ADDRESS_SIZE(a->family)); } int local_addresses(sd_rtnl *context, int ifindex, int af, struct local_address **ret) { -- 2.30.2