-
-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[client] Add experimental support for userspace routing #3134
base: main
Are you sure you want to change the base?
Conversation
1370bfb
to
fb1a107
Compare
6bb583e
to
2930288
Compare
aff0b49
to
af46f25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 41 out of 56 changed files in this pull request and generated 1 comment.
Files not reviewed (15)
- client/firewall/uspfilter/conntrack/udp_test.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/icmp_test.go: Evaluated as low risk
- client/firewall/create.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/tcp_test.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/common.go: Evaluated as low risk
- client/firewall/create_linux.go: Evaluated as low risk
- client/firewall/nftables/manager_linux.go: Evaluated as low risk
- client/firewall/uspfilter/allow_netbird.go: Evaluated as low risk
- client/firewall/manager/firewall.go: Evaluated as low risk
- client/firewall/uspfilter/allow_netbird_windows.go: Evaluated as low risk
- client/firewall/iptables/manager_linux.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/udp.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/common_test.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/tcp.go: Evaluated as low risk
- client/firewall/uspfilter/conntrack/icmp.go: Evaluated as low risk
Comments suppressed due to low confidence (2)
client/firewall/iface.go:15
- [nitpick] The method name GetDevice is ambiguous. It should be renamed to GetFilteredDevice to be more descriptive.
GetDevice() *device.FilteredDevice
client/firewall/iface.go:16
- [nitpick] The method name GetWGDevice is ambiguous. It should be renamed to GetWireGuardDevice to be more descriptive.
GetWGDevice() *wgdevice.Device
Quality Gate passedIssues Measures |
return "" | ||
} | ||
|
||
func (e *endpoint) WritePackets(pkts stack.PacketBufferList) (int, tcpip.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This never return with error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but we have to implement this interface:
// LinkWriter is an interface that supports sending packets via a data-link
// layer endpoint. It is used with QueueingDiscipline to batch writes from
// upper layer endpoints.
type LinkWriter interface {
// WritePackets writes packets. Must not be called with an empty list of
// packet buffers.
//
// Each packet must have the link-layer header set, if the link requires
// one.
//
// WritePackets may modify the packet buffers, and takes ownership of the PacketBufferList.
// it is not safe to use the PacketBufferList after a call to WritePackets.
WritePackets(PacketBufferList) (int, tcpip.Error)
}
Describe your changes
New environment variables:
NB_DISABLE_USERSPACE_ROUTING
: Disables userspace routingNB_FORCE_USERSPACE_ROUTER
: Forces use of userspace routing even if native OS routing is availableNB_ENABLE_NETSTACK_LOCAL_FORWARDING
: Enables forwarding to localhost in netstack modeNew flow
Example tracer output:
Issue ticket number and link
Checklist