add entrypoint for router handler

This commit is contained in:
ginuerzh
2025-02-08 23:07:54 +08:00
parent 9cd03b6b59
commit 08ad260606
14 changed files with 259 additions and 122 deletions
+1 -1
View File
@@ -272,7 +272,7 @@ func (h *tunHandler) findRouteFor(ctx context.Context, dst net.IP, router router
return nil
}
if route := router.GetRoute(ctx, dst); route != nil {
if route := router.GetRoute(ctx, dst.String()); route != nil {
if gw := net.ParseIP(route.Gateway); gw != nil {
if v, ok := h.routes.Load(ipToTunRouteKey(gw)); ok {
return v.(net.Addr)