Skip to content

Commit da0e2ba

Browse files
committed
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 48ed276.
1 parent 5be5d1f commit da0e2ba

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/network/networkd-address.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,7 @@ static int address_set_masquerade(Address *address, bool add) {
276276
if (address->scope >= RT_SCOPE_LINK)
277277
return 0;
278278

279-
if (address->family == AF_INET &&
280-
address->ip_masquerade_done == add)
281-
return 0;
282-
283-
if (address->family == AF_INET6 &&
284-
address->ipv6_masquerade_done == add)
279+
if (address->ip_masquerade_done == add)
285280
return 0;
286281

287282
masked = address->in_addr;
@@ -293,10 +288,7 @@ static int address_set_masquerade(Address *address, bool add) {
293288
if (r < 0)
294289
return r;
295290

296-
if (address->family == AF_INET)
297-
address->ip_masquerade_done = add;
298-
else if (address->family == AF_INET6)
299-
address->ipv6_masquerade_done = add;
291+
address->ip_masquerade_done = add;
300292

301293
return 0;
302294
}

src/network/networkd-address.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ typedef struct Address {
3838

3939
bool scope_set:1;
4040
bool ip_masquerade_done:1;
41-
bool ipv6_masquerade_done:1;
4241
AddressFamily duplicate_address_detection;
4342

4443
/* Called when address become ready */

0 commit comments

Comments
 (0)