inlet/snmp: do not deprecate default-community

We did not handle all cases, notably the case where default-community
was not set explicitely by the user. This seems a lot of code for
little gain, let's keep things simple.
This commit is contained in:
Vincent Bernat
2022-08-01 07:15:50 +02:00
parent 1bbaf4de24
commit e5d3d3fbc3
8 changed files with 13 additions and 141 deletions

View File

@@ -24,7 +24,7 @@ type SubnetMap[V any] struct {
// Lookup will search for the most specific subnet matching the
// provided IP address and return the value associated with it.
func (sm *SubnetMap[V]) Lookup(ip net.IP) (V, bool) {
if sm.tree == nil {
if sm == nil || sm.tree == nil {
var value V
return value, false
}