summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-04 04:16:29 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-04 04:16:31 +0100
commit00d75e5752f68a7b5d066158fdf0adffcaa9a7f2 (patch)
tree9ae1488ba596c9f1d4e39447fc4d3f772a15055a /src/libsystemd/sd-rtnl
parent9008e1ac925afcdef7b45042c03fa5444f1c52c2 (diff)
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.
Diffstat (limited to 'src/libsystemd/sd-rtnl')
-rw-r--r--src/libsystemd/sd-rtnl/local-addresses.c2
1 files changed, 1 insertions, 1 deletions
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) {