mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1246 from mrjana/overlay
Process only misses on IP belonging to network
This commit is contained in:
commit
15ee7ae763
1 changed files with 18 additions and 0 deletions
|
@ -545,6 +545,12 @@ func (n *network) watchMiss(nlSock *nl.NetlinkSocket) {
|
||||||
if neigh.IP.To4() == nil {
|
if neigh.IP.To4() == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Not any of the network's subnets. Ignore.
|
||||||
|
if !n.contains(neigh.IP) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
logrus.Debugf("miss notification for dest IP, %v", neigh.IP.String())
|
logrus.Debugf("miss notification for dest IP, %v", neigh.IP.String())
|
||||||
|
|
||||||
if neigh.State&(netlink.NUD_STALE|netlink.NUD_INCOMPLETE) == 0 {
|
if neigh.State&(netlink.NUD_STALE|netlink.NUD_INCOMPLETE) == 0 {
|
||||||
|
@ -825,6 +831,18 @@ func (n *network) obtainVxlanID(s *subnet) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// contains return true if the passed ip belongs to one the network's
|
||||||
|
// subnets
|
||||||
|
func (n *network) contains(ip net.IP) bool {
|
||||||
|
for _, s := range n.subnets {
|
||||||
|
if s.subnetIP.Contains(ip) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// getSubnetforIP returns the subnet to which the given IP belongs
|
// getSubnetforIP returns the subnet to which the given IP belongs
|
||||||
func (n *network) getSubnetforIP(ip *net.IPNet) *subnet {
|
func (n *network) getSubnetforIP(ip *net.IPNet) *subnet {
|
||||||
for _, s := range n.subnets {
|
for _, s := range n.subnets {
|
||||||
|
|
Loading…
Add table
Reference in a new issue