Fix rule match

This commit is contained in:
世界
2024-01-14 13:01:57 +08:00
parent f31c604b3d
commit c4d9be9e0d
6 changed files with 11 additions and 11 deletions

View File

@@ -72,7 +72,7 @@ func (r *abstractDefaultRule) Match(metadata *adapter.InboundContext) bool {
}
}
if len(r.sourcePortItems) > 0 && !metadata.SourceAddressMatch {
if len(r.sourcePortItems) > 0 && !metadata.SourcePortMatch {
for _, item := range r.sourcePortItems {
if item.Match(metadata) {
metadata.SourcePortMatch = true
@@ -81,7 +81,7 @@ func (r *abstractDefaultRule) Match(metadata *adapter.InboundContext) bool {
}
}
if len(r.destinationAddressItems) > 0 && !metadata.SourceAddressMatch {
if len(r.destinationAddressItems) > 0 && !metadata.DestinationAddressMatch {
for _, item := range r.destinationAddressItems {
if item.Match(metadata) {
metadata.DestinationAddressMatch = true
@@ -90,7 +90,7 @@ func (r *abstractDefaultRule) Match(metadata *adapter.InboundContext) bool {
}
}
if len(r.destinationPortItems) > 0 && !metadata.SourceAddressMatch {
if len(r.destinationPortItems) > 0 && !metadata.DestinationPortMatch {
for _, item := range r.destinationPortItems {
if item.Match(metadata) {
metadata.DestinationPortMatch = true