Browse Source

Merge pull request #630 from tomdee/host-gw-memory

backend/hostgw: Fix memory leak
Tom Denham 8 years ago
parent
commit
af2aebf802
1 changed files with 5 additions and 0 deletions
  1. 5 0
      backend/hostgw/network.go

+ 5 - 0
backend/hostgw/network.go

@@ -144,6 +144,11 @@ func (n *network) handleSubnetEvents(batch []subnet.Event) {
 }
 
 func (n *network) addToRouteList(route netlink.Route) {
+	for _, r := range n.rl {
+		if routeEqual(r, route) {
+			return
+		}
+	}
 	n.rl = append(n.rl, route)
 }