diff --git a/inside.go b/inside.go index 177bcd3..5ed152c 100644 --- a/inside.go +++ b/inside.go @@ -25,8 +25,9 @@ func (f *Interface) consumeInsidePacket(packet []byte, fwPacket *firewall.Packet 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. + // This should only happen on Darwin-based and FreeBSD 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 { diff --git a/inside_bsd.go b/inside_bsd.go new file mode 100644 index 0000000..c9c7730 --- /dev/null +++ b/inside_bsd.go @@ -0,0 +1,6 @@ +//go:build darwin || dragonfly || freebsd || netbsd || openbsd +// +build darwin dragonfly freebsd netbsd openbsd + +package nebula + +const immediatelyForwardToSelf bool = true diff --git a/inside_darwin.go b/inside_darwin.go deleted file mode 100644 index a3b98ba..0000000 --- a/inside_darwin.go +++ /dev/null @@ -1,3 +0,0 @@ -package nebula - -const immediatelyForwardToSelf bool = true diff --git a/inside_generic.go b/inside_generic.go index 8eb98e8..0bb2345 100644 --- a/inside_generic.go +++ b/inside_generic.go @@ -1,5 +1,5 @@ -//go:build !darwin -// +build !darwin +//go:build !darwin && !dragonfly && !freebsd && !netbsd && !openbsd +// +build !darwin,!dragonfly,!freebsd,!netbsd,!openbsd package nebula