summaryrefslogtreecommitdiff
path: root/src/shared/firewall-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/firewall-util.c')
-rw-r--r--src/shared/firewall-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c
index 3a6e987ee1..6d295ea65b 100644
--- a/src/shared/firewall-util.c
+++ b/src/shared/firewall-util.c
@@ -110,7 +110,7 @@ int fw_add_masquerade(
if (af != AF_INET)
return -EOPNOTSUPP;
- if (protocol != 0 && protocol != IPPROTO_TCP && protocol != IPPROTO_UDP)
+ if (!IN_SET(protocol, 0, IPPROTO_TCP, IPPROTO_UDP))
return -EOPNOTSUPP;
h = iptc_init("nat");
@@ -194,7 +194,7 @@ int fw_add_local_dnat(
if (af != AF_INET)
return -EOPNOTSUPP;
- if (protocol != IPPROTO_TCP && protocol != IPPROTO_UDP)
+ if (!IN_SET(protocol, IPPROTO_TCP, IPPROTO_UDP))
return -EOPNOTSUPP;
if (local_port <= 0)