mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-01 20:43:43 +01:00
c9b2ce08eb
In case the 53 UDP port is not an option to bind then we hijack the DNS traffic with eBPF, and we forward the traffic to the listener on a custom port. With this implementation, we should be able to listen to DNS queries on any address and still set the local host system to send queries to the custom address on port 53. Because we tried to attach multiple XDP programs to the same interface, I did a refactor in the WG traffic forward code also.
16 lines
529 B
Go
16 lines
529 B
Go
//go:build !android
|
|
|
|
package ebpf
|
|
|
|
import (
|
|
"github.com/netbirdio/netbird/client/internal/ebpf/ebpf"
|
|
"github.com/netbirdio/netbird/client/internal/ebpf/manager"
|
|
)
|
|
|
|
// GetEbpfManagerInstance is a wrapper function. This encapsulation is required because if the code import the internal
|
|
// ebpf package the Go compiler will include the object files. But it is not supported on Android. It can cause instant
|
|
// panic on older Android version.
|
|
func GetEbpfManagerInstance() manager.Manager {
|
|
return ebpf.GetEbpfManagerInstance()
|
|
}
|