Bring in netstack locally

This commit is contained in:
Owen
2025-11-05 13:39:54 -08:00
parent 6226a262d6
commit 348cac66c8
7 changed files with 1092 additions and 33 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/fosrl/newt/docker"
"github.com/fosrl/newt/healthcheck"
"github.com/fosrl/newt/logger"
"github.com/fosrl/newt/netstack2"
"github.com/fosrl/newt/proxy"
"github.com/fosrl/newt/updates"
"github.com/fosrl/newt/websocket"
@@ -30,7 +31,6 @@ import (
"golang.zx2c4.com/wireguard/conn"
"golang.zx2c4.com/wireguard/device"
"golang.zx2c4.com/wireguard/tun"
"golang.zx2c4.com/wireguard/tun/netstack"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
@@ -531,7 +531,7 @@ func main() {
// Create TUN device and network stack
var tun tun.Device
var tnet *netstack.Net
var tnet *netstack2.Net
var dev *device.Device
var pm *proxy.ProxyManager
var connected bool
@@ -637,7 +637,7 @@ func main() {
}
logger.Debug(fmtReceivedMsg, msg)
tun, tnet, err = netstack.CreateNetTUN(
tun, tnet, err = netstack2.CreateNetTUN(
[]netip.Addr{netip.MustParseAddr(wgData.TunnelIP)},
[]netip.Addr{netip.MustParseAddr(dns)},
mtuInt)