From 0daf1e65cecc06fe936b9ce9d9a9220890051ae4 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Wed, 4 Dec 2024 01:22:35 +0900 Subject: [PATCH] service-proxy:Fixed regression issue with flannel --- api/loxinlp/nlp.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/loxinlp/nlp.go b/api/loxinlp/nlp.go index ff9d119a1..050acc8b0 100644 --- a/api/loxinlp/nlp.go +++ b/api/loxinlp/nlp.go @@ -1070,6 +1070,14 @@ func AddNeigh(neigh nlp.Neigh, link nlp.Link) int { return 0 } brId, _ = strconv.Atoi(strings.Join(re.FindAllString(brLink.Attrs().Name, -1), " ")) + // Dirty hack to support docker bridge + if brId == 0 { + if brLink.Attrs().Name == "docker0" { + brId = 4090 + } else if brLink.Attrs().Name == "cni0" { + brId = 4091 + } + } } if vxlan, ok := link.(*nlp.Vxlan); ok { @@ -1157,6 +1165,14 @@ func DelNeigh(neigh nlp.Neigh, link nlp.Link) int { return 0 } brId, _ = strconv.Atoi(strings.Join(re.FindAllString(brLink.Attrs().Name, -1), " ")) + // Dirty hack to support docker bridge + if brId == 0 { + if brLink.Attrs().Name == "docker0" { + brId = 4090 + } else if brLink.Attrs().Name == "cni0" { + brId = 4091 + } + } } if vxlan, ok := link.(*nlp.Vxlan); ok {