Skip to content

Commit

Permalink
lowercase proto
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Feb 6, 2024
1 parent 32b5601 commit 8cd77d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/netconf/nftables.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func getFirewallRules(c config) FirewallRules {
continue
}
egressRules = append(egressRules,
fmt.Sprintf("ip saddr { 10.0.0.0/8 } %s daddr %s %s dport { %s } accept comment %q", af, daddr, r.Protocol, strings.Join(ports, ","), r.Comment))
fmt.Sprintf("ip saddr { 10.0.0.0/8 } %s daddr %s %s dport { %s } accept comment %q", af, daddr, strings.ToLower(r.Protocol), strings.Join(ports, ","), r.Comment))
}
}
for _, r := range c.FirewallRules.Ingress {
Expand All @@ -232,7 +232,7 @@ func getFirewallRules(c config) FirewallRules {
if err != nil {
continue
}
ingressRules = append(ingressRules, fmt.Sprintf("ip daddr { 10.0.0.0/8 } %s saddr %s %s dport { %s } accept comment %q", af, saddr, r.Protocol, strings.Join(ports, ","), r.Comment))
ingressRules = append(ingressRules, fmt.Sprintf("ip daddr { 10.0.0.0/8 } %s saddr %s %s dport { %s } accept comment %q", af, saddr, strings.ToLower(r.Protocol), strings.Join(ports, ","), r.Comment))
}
}
return FirewallRules{
Expand Down
2 changes: 1 addition & 1 deletion pkg/netconf/testdata/firewall_with_rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ firewall_rules:
- "0.0.0.0/0"
- "::/0"
ingress:
- protocol: tcp
- protocol: TCP
ports: [80,443,8080]
from_cidrs:
- "1.2.3.0/24"
Expand Down

0 comments on commit 8cd77d3

Please sign in to comment.