From 36790652585662dd1afee3eacb47017958f33c7d Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Wed, 27 Jan 2016 22:02:07 +0000 Subject: [PATCH] cope with nil route.Dst Fixes #1932. --- net/if.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/if.go b/net/if.go index dc391b83..f8904f55 100644 --- a/net/if.go +++ b/net/if.go @@ -53,7 +53,7 @@ func EnsureInterfaceAndMcastRoute(ifaceName string) (*net.Interface, error) { } dest := net.IPv4(224, 0, 0, 0) check := func(route netlink.Route) bool { - return route.LinkIndex == iface.Index && route.Dst.IP.Equal(dest) + return route.LinkIndex == iface.Index && route.Dst != nil && route.Dst.IP.Equal(dest) } // check for currently-existing route after subscribing, to avoid race routes, err := netlink.RouteList(nil, netlink.FAMILY_V4)