mirror of
https://github.com/systemd/systemd.git
synced 2025-03-08 08:58:27 +03:00
local-addresses: always sort and dedup even if addresses are not requested
Otherwise, the return value may different when ret is NULL or not.
This commit is contained in:
parent
e90863f231
commit
a64f60416c
@ -168,11 +168,11 @@ int local_addresses(
|
||||
n_list++;
|
||||
};
|
||||
|
||||
if (ret) {
|
||||
typesafe_qsort(list, n_list, address_compare);
|
||||
suppress_duplicates(list, &n_list);
|
||||
typesafe_qsort(list, n_list, address_compare);
|
||||
suppress_duplicates(list, &n_list);
|
||||
|
||||
if (ret)
|
||||
*ret = TAKE_PTR(list);
|
||||
}
|
||||
|
||||
return (int) n_list;
|
||||
}
|
||||
@ -370,11 +370,11 @@ int local_gateways(
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
typesafe_qsort(list, n_list, address_compare);
|
||||
suppress_duplicates(list, &n_list);
|
||||
typesafe_qsort(list, n_list, address_compare);
|
||||
suppress_duplicates(list, &n_list);
|
||||
|
||||
if (ret)
|
||||
*ret = TAKE_PTR(list);
|
||||
}
|
||||
|
||||
return (int) n_list;
|
||||
}
|
||||
@ -515,11 +515,11 @@ int local_outbounds(
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
typesafe_qsort(list, n_list, address_compare);
|
||||
suppress_duplicates(list, &n_list);
|
||||
typesafe_qsort(list, n_list, address_compare);
|
||||
suppress_duplicates(list, &n_list);
|
||||
|
||||
if (ret)
|
||||
*ret = TAKE_PTR(list);
|
||||
}
|
||||
|
||||
return (int) n_list;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user