mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-08-24 09:50:02 +03:00
network: address: reuse Address:ip_masquerade_done for IPv6 case
It is not necessary to use different flag for each address family.
Follow-up for 48ed276647
.
This commit is contained in:
@ -276,12 +276,7 @@ static int address_set_masquerade(Address *address, bool add) {
|
||||
if (address->scope >= RT_SCOPE_LINK)
|
||||
return 0;
|
||||
|
||||
if (address->family == AF_INET &&
|
||||
address->ip_masquerade_done == add)
|
||||
return 0;
|
||||
|
||||
if (address->family == AF_INET6 &&
|
||||
address->ipv6_masquerade_done == add)
|
||||
if (address->ip_masquerade_done == add)
|
||||
return 0;
|
||||
|
||||
masked = address->in_addr;
|
||||
@ -293,10 +288,7 @@ static int address_set_masquerade(Address *address, bool add) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (address->family == AF_INET)
|
||||
address->ip_masquerade_done = add;
|
||||
else if (address->family == AF_INET6)
|
||||
address->ipv6_masquerade_done = add;
|
||||
address->ip_masquerade_done = add;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ typedef struct Address {
|
||||
|
||||
bool scope_set:1;
|
||||
bool ip_masquerade_done:1;
|
||||
bool ipv6_masquerade_done:1;
|
||||
AddressFamily duplicate_address_detection;
|
||||
|
||||
/* Called when address become ready */
|
||||
|
Reference in New Issue
Block a user