diff mbox series

[firewall3] zones: limit masq_allow_invalid effect to ipv4 family

Message ID 1593614640-14555-1-git-send-email-alin.nastac@gmail.com
State Needs Review / ACK
Headers show
Series [firewall3] zones: limit masq_allow_invalid effect to ipv4 family | expand

Commit Message

Alin Năstac July 1, 2020, 2:44 p.m. UTC
Preventing NAT leakage on ipv6 doesn't make sense, as
all other masq* options have effect only on ipv4.

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
---
 zones.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/zones.c b/zones.c
index 68b02ab..dbf23dc 100644
--- a/zones.c
+++ b/zones.c
@@ -501,7 +501,7 @@  print_interface_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
 
 			if (has(zone->flags, handle->family, t))
 			{
-				if (t == FW3_FLAG_ACCEPT &&
+				if (t == FW3_FLAG_ACCEPT && handle->family == FW3_FAMILY_V4 &&
 				    zone->masq && !zone->masq_allow_invalid)
 				{
 					r = fw3_ipt_rule_create(handle, NULL, NULL, dev, NULL, sub);