1
1
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:
Yu Watanabe
2021-02-17 16:06:31 +09:00
parent 5be5d1f2a1
commit da0e2baea3
2 changed files with 2 additions and 11 deletions

View File

@ -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;
}

View File

@ -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 */