]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Add separate validation for duplicate ASPA providers
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 6 Mar 2026 18:52:27 +0000 (12:52 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 6 Mar 2026 18:52:27 +0000 (12:52 -0600)
Fixes #166.

src/object/aspa.c

index 7e9cef69c69f458faad3582b4b77daeaa34d9529..0ea508349f4eebc103980094f64013f7609131bf 100644 (file)
@@ -100,9 +100,15 @@ parse_providers(ProviderASSet_t *set, struct aspa *aspa)
                            aspa->customer);
                        goto cancel;
                }
-               if (i != 0 && providers[i - 1] >= providers[i]) {
-                       error = pr_val_err("The Provider ASIDs are not listed in ascending order.");
-                       goto cancel;
+               if (i != 0) {
+                       if (providers[i - 1] == providers[i]) {
+                               error = pr_val_err("Provider ASID '%u' is listed more than once.", providers[i]);
+                               goto cancel;
+                       }
+                       if (providers[i - 1] > providers[i]) {
+                               error = pr_val_err("The Provider ASIDs are not listed in ascending order.");
+                               goto cancel;
+                       }
                }
        }