Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
6c95ca9086
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)
 	}