Skip to content

Commit

Permalink
Fix IP filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Herms committed Jan 15, 2021
1 parent 5e1b3ab commit 5f54792
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/frontend/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,13 @@ func (fe *Frontend) processQuery(r *http.Request) (*result, error) {
case string:
keyComponents = append(keyComponents, fmt.Sprintf("%s=%s", label, (*valuePtrs[i].(*interface{})).(string)))
case net.IP:
keyComponents = append(keyComponents, fmt.Sprintf("%s=%s", label, (*valuePtrs[i].(*interface{})).(net.IP).String()))
addr := (*valuePtrs[i].(*interface{})).(net.IP)
if addr.To4() == nil {
keyComponents = append(keyComponents, fmt.Sprintf("%s=IPv6StringToNum(%s)", label, addr.String()))
} else {
keyComponents = append(keyComponents, fmt.Sprintf("%s=IPv4ToIPv6(IPv4StringToNum(%s))", label, addr.String()))
}

}
}

Expand Down
1 change: 0 additions & 1 deletion pkg/servers/sflow/sfserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ func (sfs *SflowServer) processPacket(agent bnet.IP, buffer []byte) {
}

if fl.IntIn == "" {

fl.IntIn += fmt.Sprintf("%d", fs.FlowSampleHeader.InputIf)
}

Expand Down

0 comments on commit 5f54792

Please sign in to comment.