Skip to content

Commit

Permalink
Fix: NoResolveIP should return current value (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fndroid authored and Dreamacro committed Nov 4, 2019
1 parent 1948ea1 commit e103040
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func parseRules(cfg *rawConfig, proxies map[string]C.Proxy) ([]C.Rule, error) {
case "SOURCE-IP-CIDR":
fallthrough
case "SRC-IP-CIDR":
parsed, parseErr = R.NewIPCIDR(payload, target, R.WithIPCIDRSourceIP(true))
parsed, parseErr = R.NewIPCIDR(payload, target, R.WithIPCIDRSourceIP(true), R.WithIPCIDRNoResolve(true))
case "SRC-PORT":
parsed, parseErr = R.NewPort(payload, target, true)
case "DST-PORT":
Expand Down
2 changes: 1 addition & 1 deletion rules/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (d *Domain) Payload() string {
}

func (d *Domain) NoResolveIP() bool {
return false
return true
}

func NewDomain(domain string, adapter string) *Domain {
Expand Down
2 changes: 1 addition & 1 deletion rules/domain_keyword.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (dk *DomainKeyword) Payload() string {
}

func (dk *DomainKeyword) NoResolveIP() bool {
return false
return true
}

func NewDomainKeyword(keyword string, adapter string) *DomainKeyword {
Expand Down
2 changes: 1 addition & 1 deletion rules/domain_suffix.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (ds *DomainSuffix) Payload() string {
}

func (ds *DomainSuffix) NoResolveIP() bool {
return false
return true
}

func NewDomainSuffix(suffix string, adapter string) *DomainSuffix {
Expand Down
2 changes: 1 addition & 1 deletion rules/final.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (f *Match) Payload() string {
}

func (f *Match) NoResolveIP() bool {
return false
return true
}

func NewMatch(adapter string) *Match {
Expand Down
2 changes: 1 addition & 1 deletion rules/ipcidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func WithIPCIDRSourceIP(b bool) IPCIDROption {

func WithIPCIDRNoResolve(noResolve bool) IPCIDROption {
return func(i *IPCIDR) {
i.noResolveIP = !noResolve
i.noResolveIP = noResolve
}
}

Expand Down
2 changes: 1 addition & 1 deletion rules/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (p *Port) Payload() string {
}

func (p *Port) NoResolveIP() bool {
return false
return true
}

func NewPort(port string, adapter string, isSource bool) (*Port, error) {
Expand Down

0 comments on commit e103040

Please sign in to comment.