From 2316e7a0d479d63f5c7431c779e13e7ab8fe4751 Mon Sep 17 00:00:00 2001 From: detailyang Date: Fri, 3 Mar 2023 10:33:14 +0800 Subject: [PATCH 1/5] bugfix:avoid busy loop Incomplete ARP entry (nil mac address)can cause the busy loop --- felix/routetable/route_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/felix/routetable/route_table.go b/felix/routetable/route_table.go index 7641e88d4f7..f2fa0ed5801 100644 --- a/felix/routetable/route_table.go +++ b/felix/routetable/route_table.go @@ -1035,7 +1035,7 @@ func (r *RouteTable) syncL2RoutesForLink(ifaceName string) error { var updatesFailed bool for _, existing := range existingNeigh { - if _, ok := expected[existing.HardwareAddr.String()]; !ok { + if _, ok := expected[existing.HardwareAddr.String()]; !ok && existing.HardwareAddr != nil { logCxt.WithField("neighbor", existing).Debug("Neighbor should no longer be programmed") // Remove the FDB entry for this neighbor. From b23defe379ac72306c718ceaac7166579d04f6d8 Mon Sep 17 00:00:00 2001 From: detailyang Date: Thu, 9 Mar 2023 17:21:35 +0800 Subject: [PATCH 2/5] Update felix/routetable/route_table.go Co-authored-by: Shaun Crampton --- felix/routetable/route_table.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/felix/routetable/route_table.go b/felix/routetable/route_table.go index f2fa0ed5801..480c58e03f0 100644 --- a/felix/routetable/route_table.go +++ b/felix/routetable/route_table.go @@ -1035,7 +1035,11 @@ func (r *RouteTable) syncL2RoutesForLink(ifaceName string) error { var updatesFailed bool for _, existing := range existingNeigh { - if _, ok := expected[existing.HardwareAddr.String()]; !ok && existing.HardwareAddr != nil { + if existing.HardwareAddr == nil { + log.WithField("entry", entry).Debug("Ignoring existing ARP entry with no hardware addr") + continue + } + if _, ok := expected[existing.HardwareAddr.String()]; !ok { logCxt.WithField("neighbor", existing).Debug("Neighbor should no longer be programmed") // Remove the FDB entry for this neighbor. From 910e53b57260ed1aae948bf84dd349dac346edbe Mon Sep 17 00:00:00 2001 From: detailyang Date: Thu, 13 Apr 2023 13:54:56 +0800 Subject: [PATCH 3/5] chore:apply make fix --- felix/routetable/route_table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/felix/routetable/route_table.go b/felix/routetable/route_table.go index 480c58e03f0..e61b601995b 100644 --- a/felix/routetable/route_table.go +++ b/felix/routetable/route_table.go @@ -1036,8 +1036,8 @@ func (r *RouteTable) syncL2RoutesForLink(ifaceName string) error { for _, existing := range existingNeigh { if existing.HardwareAddr == nil { - log.WithField("entry", entry).Debug("Ignoring existing ARP entry with no hardware addr") - continue + log.WithField("entry", entry).Debug("Ignoring existing ARP entry with no hardware addr") + continue } if _, ok := expected[existing.HardwareAddr.String()]; !ok { logCxt.WithField("neighbor", existing).Debug("Neighbor should no longer be programmed") From 4fa282b2a9bb4032ac09ee6de4063ec6ca882494 Mon Sep 17 00:00:00 2001 From: detailyang Date: Thu, 13 Apr 2023 13:54:56 +0800 Subject: [PATCH 4/5] chore:apply make fix --- felix/routetable/route_table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/felix/routetable/route_table.go b/felix/routetable/route_table.go index 480c58e03f0..e61b601995b 100644 --- a/felix/routetable/route_table.go +++ b/felix/routetable/route_table.go @@ -1036,8 +1036,8 @@ func (r *RouteTable) syncL2RoutesForLink(ifaceName string) error { for _, existing := range existingNeigh { if existing.HardwareAddr == nil { - log.WithField("entry", entry).Debug("Ignoring existing ARP entry with no hardware addr") - continue + log.WithField("entry", entry).Debug("Ignoring existing ARP entry with no hardware addr") + continue } if _, ok := expected[existing.HardwareAddr.String()]; !ok { logCxt.WithField("neighbor", existing).Debug("Neighbor should no longer be programmed") From c091d4552accbe5154be071d0ae02533ff931715 Mon Sep 17 00:00:00 2001 From: detailyang Date: Tue, 18 Apr 2023 16:09:30 +0800 Subject: [PATCH 5/5] chore:build:fix build error Signed-off-by: detailyang --- felix/routetable/route_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/felix/routetable/route_table.go b/felix/routetable/route_table.go index e61b601995b..17eef330dfc 100644 --- a/felix/routetable/route_table.go +++ b/felix/routetable/route_table.go @@ -1036,7 +1036,7 @@ func (r *RouteTable) syncL2RoutesForLink(ifaceName string) error { for _, existing := range existingNeigh { if existing.HardwareAddr == nil { - log.WithField("entry", entry).Debug("Ignoring existing ARP entry with no hardware addr") + log.WithField("neighbor", existing).Debug("Ignoring existing ARP entry with no hardware addr") continue } if _, ok := expected[existing.HardwareAddr.String()]; !ok {