Skip to content

Commit

Permalink
Immediately forward packets from self to self on FreeBSD (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaguire authored Jan 23, 2023
1 parent 0fc4d81 commit 5bd8712
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 3 additions & 2 deletions inside.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions inside_bsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd

package nebula

const immediatelyForwardToSelf bool = true
3 changes: 0 additions & 3 deletions inside_darwin.go

This file was deleted.

4 changes: 2 additions & 2 deletions inside_generic.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !darwin
// +build !darwin
//go:build !darwin && !dragonfly && !freebsd && !netbsd && !openbsd
// +build !darwin,!dragonfly,!freebsd,!netbsd,!openbsd

package nebula

Expand Down

0 comments on commit 5bd8712

Please sign in to comment.