From fb84409e2adc596c3d0820993fec84728f35ed95 Mon Sep 17 00:00:00 2001 From: Will Scott Date: Sun, 8 Mar 2020 12:51:43 -0700 Subject: [PATCH] fixup --- netroute_linux.go | 2 ++ netroute_windows.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/netroute_linux.go b/netroute_linux.go index 02730e9..34ff107 100644 --- a/netroute_linux.go +++ b/netroute_linux.go @@ -3,6 +3,8 @@ package netroute import ( + "net" + "github.com/google/gopacket/routing" ) diff --git a/netroute_windows.go b/netroute_windows.go index f3dd4e1..2ce0ef1 100644 --- a/netroute_windows.go +++ b/netroute_windows.go @@ -222,7 +222,7 @@ func (r *winRouter) RouteWithSrc(input net.HardwareAddr, src, dst net.IP) (iface } iface = getIface(route.index) - if route.nextHop.Addr.Family == 0 /* AF_UNDEF */ { + if route nextHop == nil || route.nextHop.Addr.Family == 0 /* AF_UNDEF */ { return iface, nil, pref, nil } addr, err := route.nextHop.Sockaddr()