瀏覽代碼

netlink: ignore route updates with no destination

Currently we assume each route update must have a destination, but we
should check that it is set before we try to use it.

See: #1436
Wade Simmons 2 天之前
父節點
當前提交
cc2722424e
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      overlay/tun_linux.go

+ 5 - 0
overlay/tun_linux.go

@@ -638,6 +638,11 @@ func (t *tun) updateRoutes(r netlink.RouteUpdate) {
 		return
 		return
 	}
 	}
 
 
+	if r.Dst == nil {
+		t.l.WithField("route", r).Debug("Ignoring route update, no destination address")
+		return
+	}
+
 	dstAddr, ok := netip.AddrFromSlice(r.Dst.IP)
 	dstAddr, ok := netip.AddrFromSlice(r.Dst.IP)
 	if !ok {
 	if !ok {
 		t.l.WithField("route", r).Debug("Ignoring route update, invalid destination address")
 		t.l.WithField("route", r).Debug("Ignoring route update, invalid destination address")