From 07cbed53c9dc480a8bd35cd638eaa2e4888d3351 Mon Sep 17 00:00:00 2001 From: zhangtian Date: Thu, 14 Mar 2024 18:17:24 +0800 Subject: [PATCH] fix udp match, set default port to -1 --- iptables/match.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iptables/match.go b/iptables/match.go index ef4beb7..50b5f11 100644 --- a/iptables/match.go +++ b/iptables/match.go @@ -12,6 +12,7 @@ import ( "strings" "github.com/singchia/go-hammer/tree" + "github.com/singchia/go-xtables" "github.com/singchia/go-xtables/pkg/network" ) @@ -10284,6 +10285,10 @@ func newMatchUDP(opts ...OptionMatchUDP) (*MatchUDP, error) { baseMatch: &baseMatch{ matchType: MatchTypeUDP, }, + SrcPortMin: -1, + SrcPortMax: -1, + DstPortMin: -1, + DstPortMax: -1, } for _, opt := range opts { opt(match)