mirror of
https://github.com/systemd/systemd.git
synced 2025-01-18 10:04:04 +03:00
network: compare with peer address if it is specified
Follow-ups for dfef713f3e390ced671ce0ee87782cc373c937d0.
This commit is contained in:
parent
01b92946c5
commit
6f5d73aba6
@ -1297,7 +1297,10 @@ static int link_request_set_addresses(Link *link) {
|
||||
LIST_FOREACH(addresses, ad, link->network->static_addresses) {
|
||||
bool update;
|
||||
|
||||
update = address_get(link, ad->family, &ad->in_addr, ad->prefixlen, NULL) > 0;
|
||||
if (ad->family == AF_INET6 && !in_addr_is_null(ad->family, &ad->in_addr_peer))
|
||||
update = address_get(link, ad->family, &ad->in_addr_peer, ad->prefixlen, NULL) > 0;
|
||||
else
|
||||
update = address_get(link, ad->family, &ad->in_addr, ad->prefixlen, NULL) > 0;
|
||||
|
||||
r = address_configure(ad, link, address_handler, update);
|
||||
if (r < 0)
|
||||
@ -2603,6 +2606,9 @@ static bool link_is_static_address_configured(Link *link, Address *address) {
|
||||
LIST_FOREACH(addresses, net_address, link->network->static_addresses)
|
||||
if (address_equal(net_address, address))
|
||||
return true;
|
||||
else if (address->family == AF_INET6 && net_address->family == AF_INET6 &&
|
||||
in_addr_equal(AF_INET6, &address->in_addr, &net_address->in_addr_peer) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user