Skip to content

Commit

Permalink
Always use userspace routing in netstack mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lixmal committed Jan 3, 2025
1 parent eaadb75 commit 7dfe7e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/firewall/uspfilter/uspfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,21 @@ func CreateWithNativeFirewall(iface common.IFaceMapper, nativeFirewall firewall.
forceNativeRouter, _ := strconv.ParseBool(EnvForceNativeRouter)

// if the OS supports routing natively, or it is explicitly requested, then we don't need to filter/route ourselves
if mgr.nativeFirewall != nil && mgr.nativeFirewall.IsServerRouteSupported() || forceNativeRouter {
// netstack mode won't support userspace routing as there is no interface
if forceNativeRouter ||
!netstack.IsEnabled() && mgr.nativeFirewall != nil && mgr.nativeFirewall.IsServerRouteSupported() {

mgr.nativeRouter = true
mgr.routingEnabled = true
if mgr.forwarder != nil {
mgr.forwarder.Stop()
}

log.Info("native routing is enabled")
return mgr, nil
}

log.Info("userspace routing is enabled")
return mgr, nil
}

Expand Down

0 comments on commit 7dfe7e4

Please sign in to comment.