Przeglądaj źródła

backend/udp: bind to the advertised interface

Before this fix flanneld would bind to 0.0.0.0 instead of the selected
or user specificed interface in `-iface`. This is not only unexpected
but also unnecessary because flanneld advertises its public IP through
etcd and will only expect people to talk through that IP.
Sebastian Messmer 9 lat temu
rodzic
commit
6c95ca9086
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      backend/udp/network.go

+ 1 - 1
backend/udp/network.go

@@ -64,7 +64,7 @@ func newNetwork(name string, sm subnet.Manager, extIface *backend.ExternalInterf
 	}
 
 	var err error
-	n.conn, err = net.ListenUDP("udp4", &net.UDPAddr{Port: port})
+	n.conn, err = net.ListenUDP("udp4", &net.UDPAddr{IP: extIface.IfaceAddr, Port: port})
 	if err != nil {
 		return nil, fmt.Errorf("failed to start listening on UDP socket: %v", err)
 	}