drop packets even if we aren't going to emit Debug logs about it (#239)
* drop packets even if we aren't going to emit Debug logs about it * smallify change
This commit is contained in:
parent
ff13aba8fc
commit
ecf0e5a9f6
10
inside.go
10
inside.go
|
@ -109,10 +109,12 @@ func (f *Interface) sendMessageNow(t NebulaMessageType, st NebulaMessageSubType,
|
||||||
|
|
||||||
// check if packet is in outbound fw rules
|
// check if packet is in outbound fw rules
|
||||||
dropReason := f.firewall.Drop(p, *fp, false, hostInfo, trustedCAs)
|
dropReason := f.firewall.Drop(p, *fp, false, hostInfo, trustedCAs)
|
||||||
if dropReason != nil && l.Level >= logrus.DebugLevel {
|
if dropReason != nil {
|
||||||
l.WithField("fwPacket", fp).
|
if l.Level >= logrus.DebugLevel {
|
||||||
WithField("reason", dropReason).
|
l.WithField("fwPacket", fp).
|
||||||
Debugln("dropping cached packet")
|
WithField("reason", dropReason).
|
||||||
|
Debugln("dropping cached packet")
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
outside.go
10
outside.go
|
@ -281,10 +281,12 @@ func (f *Interface) decryptToTun(hostinfo *HostInfo, messageCounter uint64, out
|
||||||
}
|
}
|
||||||
|
|
||||||
dropReason := f.firewall.Drop(out, *fwPacket, true, hostinfo, trustedCAs)
|
dropReason := f.firewall.Drop(out, *fwPacket, true, hostinfo, trustedCAs)
|
||||||
if dropReason != nil && l.Level >= logrus.DebugLevel {
|
if dropReason != nil {
|
||||||
hostinfo.logger().WithField("fwPacket", fwPacket).
|
if l.Level >= logrus.DebugLevel {
|
||||||
WithField("reason", dropReason).
|
hostinfo.logger().WithField("fwPacket", fwPacket).
|
||||||
Debugln("dropping inbound packet")
|
WithField("reason", dropReason).
|
||||||
|
Debugln("dropping inbound packet")
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue