-(dnsforward): fixed sigsegv when protection is disabled

Also, fixed all golint issues

 Closes: #941
This commit is contained in:
Andrey Meshkov
2019-08-20 00:55:32 +03:00
parent 91a1eb9e06
commit c82e93cfc7
6 changed files with 40 additions and 8 deletions

View File

@@ -148,7 +148,7 @@ const (
ReasonRewrite
)
func (i Reason) String() string {
func (r Reason) String() string {
names := []string{
"NotFilteredNotFound",
"NotFilteredWhiteList",
@@ -163,10 +163,10 @@ func (i Reason) String() string {
"Rewrite",
}
if uint(i) >= uint(len(names)) {
if uint(r) >= uint(len(names)) {
return ""
}
return names[i]
return names[r]
}
type dnsFilterContext struct {