|
@@ -23,8 +23,18 @@ func (f *Interface) consumeInsidePacket(packet []byte, fwPacket *firewall.Packet
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // Ignore packets from self to self
|
|
|
if fwPacket.RemoteIP == f.myVpnIp {
|
|
|
+ // Immediately forward packets from self to self.
|
|
|
+ // This should only happen on Darwin-based hosts, which routes packets from
|
|
|
+ // the Nebula IP to the Nebula IP through the Nebula TUN device.
|
|
|
+ if immediatelyForwardToSelf {
|
|
|
+ _, err := f.readers[q].Write(packet)
|
|
|
+ if err != nil {
|
|
|
+ f.l.WithError(err).Error("Failed to forward to tun")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // Otherwise, drop. On linux, we should never see these packets - Linux
|
|
|
+ // routes packets from the nebula IP to the nebula IP through the loopback device.
|
|
|
return
|
|
|
}
|
|
|
|