mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Ignore previous serf user events to avoid wrong fdb programming
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
parent
22d136f7d5
commit
e94edd6d6b
3 changed files with 10 additions and 3 deletions
|
@ -644,6 +644,9 @@ func (n *network) watchMiss(nlSock *nl.NetlinkSocket) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if neigh.IP.To4() == nil {
|
if neigh.IP.To4() == nil {
|
||||||
|
if neigh.HardwareAddr != nil {
|
||||||
|
logrus.Debugf("Miss notification, l2 mac %v", neigh.HardwareAddr)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ func (d *driver) serfJoin(neighIP string) error {
|
||||||
if neighIP == "" {
|
if neighIP == "" {
|
||||||
return fmt.Errorf("no neighbor to join")
|
return fmt.Errorf("no neighbor to join")
|
||||||
}
|
}
|
||||||
if _, err := d.serfInstance.Join([]string{neighIP}, false); err != nil {
|
if _, err := d.serfInstance.Join([]string{neighIP}, true); err != nil {
|
||||||
return fmt.Errorf("Failed to join the cluster at neigh IP %s: %v",
|
return fmt.Errorf("Failed to join the cluster at neigh IP %s: %v",
|
||||||
neighIP, err)
|
neighIP, err)
|
||||||
}
|
}
|
||||||
|
@ -94,8 +94,8 @@ func (d *driver) notifyEvent(event ovNotify) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *driver) processEvent(u serf.UserEvent) {
|
func (d *driver) processEvent(u serf.UserEvent) {
|
||||||
logrus.Debugf("Received user event name:%s, payload:%s\n", u.Name,
|
logrus.Debugf("Received user event name:%s, payload:%s LTime:%d \n", u.Name,
|
||||||
string(u.Payload))
|
string(u.Payload), uint64(u.LTime))
|
||||||
|
|
||||||
var dummy, action, vtepStr, nid, eid, ipStr, maskStr, macStr string
|
var dummy, action, vtepStr, nid, eid, ipStr, maskStr, macStr string
|
||||||
if _, err := fmt.Sscan(u.Name, &dummy, &vtepStr, &nid, &eid); err != nil {
|
if _, err := fmt.Sscan(u.Name, &dummy, &vtepStr, &nid, &eid); err != nil {
|
||||||
|
@ -146,6 +146,7 @@ func (d *driver) processQuery(q *serf.Query) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logrus.Debugf("Sending peer query resp mac %s, mask %s, vtep %s", peerMac, net.IP(peerIPMask), vtep)
|
||||||
q.Respond([]byte(fmt.Sprintf("%s %s %s", peerMac.String(), net.IP(peerIPMask).String(), vtep.String())))
|
q.Respond([]byte(fmt.Sprintf("%s %s %s", peerMac.String(), net.IP(peerIPMask).String(), vtep.String())))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +174,7 @@ func (d *driver) resolvePeer(nid string, peerIP net.IP) (net.HardwareAddr, net.I
|
||||||
return nil, nil, nil, fmt.Errorf("failed to parse mac: %v", err)
|
return nil, nil, nil, fmt.Errorf("failed to parse mac: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logrus.Debugf("Received peer query response, mac %s, vtep %s, mask %s", macStr, vtepStr, maskStr)
|
||||||
return mac, net.IPMask(net.ParseIP(maskStr).To4()), net.ParseIP(vtepStr), nil
|
return mac, net.IPMask(net.ParseIP(maskStr).To4()), net.ParseIP(vtepStr), nil
|
||||||
|
|
||||||
case <-time.After(time.Second):
|
case <-time.After(time.Second):
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/vishvananda/netlink"
|
"github.com/vishvananda/netlink"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ func (n *networkNamespace) AddNeighbor(dstIP net.IP, dstMac net.HardwareAddr, op
|
||||||
|
|
||||||
nh := n.findNeighbor(dstIP, dstMac)
|
nh := n.findNeighbor(dstIP, dstMac)
|
||||||
if nh != nil {
|
if nh != nil {
|
||||||
|
logrus.Debugf("Neighbor entry already present for IP %v, mac %v", dstIP, dstMac)
|
||||||
// If it exists silently return
|
// If it exists silently return
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue