From d0d33617115d908ccb9303820aa7a2bd43b292bd Mon Sep 17 00:00:00 2001 From: Pujol Date: Thu, 12 Mar 2026 18:15:17 +0100 Subject: [PATCH] [NXOS] fix: do not delete icmp redirection config Check if interface is a switchport before attempting to remove its icmp redirect configuration. --- internal/provider/cisco/nxos/provider.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/provider/cisco/nxos/provider.go b/internal/provider/cisco/nxos/provider.go index a51266ea..e48c80fc 100644 --- a/internal/provider/cisco/nxos/provider.go +++ b/internal/provider/cisco/nxos/provider.go @@ -947,9 +947,10 @@ func (p *Provider) EnsureInterface(ctx context.Context, req *provider.EnsureInte conf = append(conf, addr) } - bfd := new(BFD) - bfd.ID = name if req.Interface.Spec.BFD != nil { + bfd := new(BFD) + bfd.ID = name + f := new(Feature) f.Name = "bfd" f.AdminSt = AdminStEnabled @@ -985,8 +986,10 @@ func (p *Provider) EnsureInterface(ctx context.Context, req *provider.EnsureInte icmp.ID = name switch req.Interface.Spec.Type { case v1alpha1.InterfaceTypePhysical: - if err := p.client.Delete(ctx, icmp); err != nil { - return err + if req.Interface.Spec.Switchport == nil { + if err := p.client.Delete(ctx, icmp); err != nil { + return err + } } case v1alpha1.InterfaceTypeLoopback: icmp.Ctrl = "port-unreachable,redirect"