Skip to content

Commit

Permalink
ipn/wg: ignore reverse protocol handlers as req
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Dec 16, 2024
1 parent a72bef2 commit dc54c93
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions intra/ipn/wgproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,12 @@ func NewWgProxy(id string, ctl protect.Controller, rev netstack.GConnHandler, cf

// ref: github.com/WireGuard/wireguard-go/blob/469159ecf7/tun/netstack/tun.go#L54
func makeWgTun(id, cfg string, ctl protect.Controller, rev netstack.GConnHandler, ifopts wgifopts) (*wgtun, error) {
if rev == nil {
return nil, errMissingRev
if settings.ExperimentalWireGuard.Load() && settings.EndpointIndependentFiltering.Load() {
if rev == nil {
return nil, errMissingRev
}
} else { // do not use reverser
rev = nil
}

ctx := context.TODO()
Expand All @@ -634,7 +638,7 @@ func makeWgTun(id, cfg string, ctl protect.Controller, rev netstack.GConnHandler
s := stack.New(opts)
ep := channel.New(epsize, uint32(tunmtu), "")
netstack.SetNetstackOpts(s)
if settings.ExperimentalWireGuard.Load() && settings.EndpointIndependentFiltering.Load() {
if rev != nil { // inbound (aka reverse outbound)
netstack.OutboundTCP(s, rev.TCP())
netstack.OutboundUDP(s, rev.UDP())
}
Expand Down

0 comments on commit dc54c93

Please sign in to comment.