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.
This commit is contained in:
parent
9008e1ac92
commit
00d75e5752
|
@ -50,7 +50,7 @@ static int address_compare(const void *_a, const void *_b) {
|
||||||
if (a->ifindex > b->ifindex)
|
if (a->ifindex > b->ifindex)
|
||||||
return 1;
|
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) {
|
int local_addresses(sd_rtnl *context, int ifindex, int af, struct local_address **ret) {
|
||||||
|
|
Loading…
Reference in a new issue