Skip to content

Commit

Permalink
backend/udp: bind to the advertised interface
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smessmer authored and Brandon Philips committed Feb 3, 2016
1 parent af71a42 commit 6c95ca9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/udp/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6c95ca9

Please sign in to comment.