hotfix(firewall): handle textual values for protocols

- Alpine / iptables-legacy bug introduced in Alpine 3.22
- Alpine: what the hell? Stop introducing breaking changes in iptables on every god damn release!
This commit is contained in:
Quentin McGaw
2025-11-04 14:16:11 +00:00
parent 2e2e5f9df5
commit 6712adfe6b

View File

@@ -324,11 +324,11 @@ var ErrProtocolUnknown = errors.New("unknown protocol")
func parseProtocol(s string) (protocol string, err error) { func parseProtocol(s string) (protocol string, err error) {
switch s { switch s {
case "0", "all": case "0", "all":
case "1": case "1", "icmp":
protocol = "icmp" protocol = "icmp"
case "6": case "6", "tcp":
protocol = "tcp" protocol = "tcp"
case "17": case "17", "udp":
protocol = "udp" protocol = "udp"
default: default:
return "", fmt.Errorf("%w: %s", ErrProtocolUnknown, s) return "", fmt.Errorf("%w: %s", ErrProtocolUnknown, s)