diff --git a/internal/provider/cisco/nxos/pim.go b/internal/provider/cisco/nxos/pim.go index 49c3191f..5b85ed7f 100644 --- a/internal/provider/cisco/nxos/pim.go +++ b/internal/provider/cisco/nxos/pim.go @@ -9,6 +9,7 @@ var ( _ gnmiext.Configurable = (*PIM)(nil) _ gnmiext.Configurable = (*PIMDom)(nil) _ gnmiext.Configurable = (*StaticRPItems)(nil) + _ gnmiext.Configurable = (*StaticRP)(nil) _ gnmiext.Configurable = (*AnycastPeerItems)(nil) _ gnmiext.Configurable = (*PIMIfItems)(nil) ) diff --git a/internal/provider/cisco/nxos/provider.go b/internal/provider/cisco/nxos/provider.go index e2e176cd..b97db842 100644 --- a/internal/provider/cisco/nxos/provider.go +++ b/internal/provider/cisco/nxos/provider.go @@ -1685,7 +1685,20 @@ func (p *Provider) EnsurePIM(ctx context.Context, req *provider.EnsurePIMRequest del := make([]gnmiext.Configurable, 0, 3) if len(rpItems.StaticRPList) > 0 { - conf = append(conf, rpItems) + current := new(StaticRPItems) + if err := p.client.GetConfig(ctx, current); err != nil && !errors.Is(err, gnmiext.ErrNil) { + return err + } + for _, rp := range rpItems.StaticRPList { + if got, ok := current.StaticRPList.Get(rp.Key()); !ok || !reflect.DeepEqual(got, rp) { + conf = append(conf, rp) + } + } + for _, rp := range current.StaticRPList { + if _, ok := rpItems.StaticRPList.Get(rp.Key()); !ok { + del = append(del, rp) + } + } } else { del = append(del, rpItems) }