summaryrefslogtreecommitdiff
path: root/lib/defaults.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-04-14 16:01:21 +0300
committerGitHub <noreply@github.com>2020-04-14 16:01:21 +0300
commit0b60953ed49f77104b0fe9679c1ce4263ea967ae (patch)
tree5c91b974b7e5af2600e2c5b8d636cd7279271c0c /lib/defaults.c
parent950b395e8ed42c582cc07a46d4773a2fa17983a6 (diff)
parentd29c01db81cd55f09ec3de75b3df611e364bddc6 (diff)
Merge pull request #6221 from opensourcerouting/defaults-fix-version-cmp
lib/defaults: fix version number comparison
Diffstat (limited to 'lib/defaults.c')
-rw-r--r--lib/defaults.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/defaults.c b/lib/defaults.c
index 71ccc73cc6..7466aad5b1 100644
--- a/lib/defaults.c
+++ b/lib/defaults.c
@@ -100,10 +100,10 @@ static bool frr_match_version(const char *name, const char *vspec,
const char *version, bool check)
{
int cmp;
- static struct spec {
+ static const struct spec {
const char *str;
- bool dir, eq;
- } *s, specs[] = {
+ int dir, eq;
+ } specs[] = {
{"<=", -1, 1},
{">=", 1, 1},
{"==", 0, 1},
@@ -112,6 +112,7 @@ static bool frr_match_version(const char *name, const char *vspec,
{"=", 0, 1},
{NULL, 0, 0},
};
+ const struct spec *s;
if (!vspec)
/* NULL = all versions */