diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-06-13 10:36:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-13 10:36:57 -0400 |
| commit | f89d090230ff4c44ef90d80b4191bb6adb32f24e (patch) | |
| tree | 3c3d0cc7d2d75c9f489b8be56872786f5afa14e8 | |
| parent | e35f0668e504baef9caef2f7025052c77782ea01 (diff) | |
| parent | 9e5c9e6d6589da0d1c7f7647cf758b8ba5343bad (diff) | |
Merge pull request #13755 from LabNConsulting/ziemba/zebra-dplane-priority
zebra: bugfix dplane priority sorting
| -rw-r--r-- | zebra/zebra_dplane.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index a768c33a30..f90f9191ee 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -5546,7 +5546,7 @@ int dplane_provider_register(const char *name, struct zebra_dplane_provider **prov_p) { int ret = 0; - struct zebra_dplane_provider *p = NULL, *last; + struct zebra_dplane_provider *p = NULL, *last, *prev = NULL; /* Validate */ if (fp == NULL) { @@ -5589,10 +5589,11 @@ int dplane_provider_register(const char *name, frr_each (dplane_prov_list, &zdplane_info.dg_providers, last) { if (last->dp_priority > p->dp_priority) break; + prev = last; } if (last) - dplane_prov_list_add_after(&zdplane_info.dg_providers, last, p); + dplane_prov_list_add_after(&zdplane_info.dg_providers, prev, p); else dplane_prov_list_add_tail(&zdplane_info.dg_providers, p); |
