mirror of
https://github.com/fosrl/olm.git
synced 2026-02-08 05:56:41 +00:00
Move to userspace wg
This commit is contained in:
14
main.go
14
main.go
@@ -404,15 +404,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// logger.Info("Received: %+v", msg)
|
|
||||||
// tun, tnet, err = netstack.CreateNetTUN(
|
|
||||||
// []netip.Addr{netip.MustParseAddr(wgData.TunnelIP)},
|
|
||||||
// []netip.Addr{netip.MustParseAddr(dns)},
|
|
||||||
// mtuInt)
|
|
||||||
// if err != nil {
|
|
||||||
// logger.Error("Failed to create TUN device: %v", err)
|
|
||||||
// }
|
|
||||||
|
|
||||||
tdev, err := func() (tun.Device, error) {
|
tdev, err := func() (tun.Device, error) {
|
||||||
tunFdStr := os.Getenv(ENV_WG_TUN_FD)
|
tunFdStr := os.Getenv(ENV_WG_TUN_FD)
|
||||||
if tunFdStr == "" {
|
if tunFdStr == "" {
|
||||||
@@ -435,6 +426,11 @@ func main() {
|
|||||||
return tun.CreateTUNFromFile(file, mtuInt)
|
return tun.CreateTUNFromFile(file, mtuInt)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("Failed to create TUN device: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Create WireGuard device
|
// Create WireGuard device
|
||||||
dev = device.NewDevice(tdev, conn.NewDefaultBind(), device.NewLogger(
|
dev = device.NewDevice(tdev, conn.NewDefaultBind(), device.NewLogger(
|
||||||
mapToWireGuardLogLevel(loggerLevel),
|
mapToWireGuardLogLevel(loggerLevel),
|
||||||
|
|||||||
Reference in New Issue
Block a user