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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user