Skip to content

Commit 5f78a42

Browse files
committed
Fix map lookup and introduce some logging
1 parent a4e9757 commit 5f78a42

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/neighborsync/neighborsync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (n *NeighborSync) processUpdate(update *netlink.NeighUpdate) {
226226
return
227227
}
228228

229-
if _, ok := n.neighRefreshInterfaces.Load(update.Neigh.LinkIndex); ok {
229+
if _, ok := n.neighRefreshInterfaces.Load(update.Neigh.LinkIndex); !ok {
230230
return
231231
}
232232

@@ -359,7 +359,7 @@ func (n *NeighborSync) runBpfNeighborSync() {
359359
copy(ev.IP[:], b[11:27])
360360

361361
skipping := false
362-
if _, ok := n.receiveNeighbors.Load(int(ev.Ifindex)); ok {
362+
if _, ok := n.receiveNeighbors.Load(int(ev.Ifindex)); !ok {
363363
skipping = true
364364
}
365365

pkg/reconciler/layer2.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ func (r *reconcile) applyConfiguration(desired, current *nl.Layer2Information, a
227227
*anycastTrackerInterfaces = append(*anycastTrackerInterfaces, bridgeID)
228228
}
229229

230+
r.logger.Info("Applying Layer2 configuration", "vlan", desired.VlanID, "vni", desired.VNI, "macvlanBridgeId", current.MacVLANBridgeID(), "bridgeId", current.BridgeID(), "neighSuppression", desired.IsNeighSuppressionEnabled())
230231
if current.MacVLANBridgeID() != -1 {
231232
if desired.IsNeighSuppressionEnabled() {
232233
if err := r.neighborSync.EnsureNeighborSuppression(current.BridgeID(), current.MacVLANBridgeID()); err != nil {
234+
r.logger.Error(err, "error ensuring neighbor suppression for macvlan bridge", "vlanId", desired.VlanID, "macvlanBridgeId", current.MacVLANBridgeID())
233235
return fmt.Errorf("error ensuring neighbor suppression for vlanId %d: %w", desired.VlanID, err)
234236
}
235237
} else {

0 commit comments

Comments
 (0)