]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/defaults.c
Merge pull request #12816 from gpnaveen/stc_rte_err_msg
[mirror_frr.git] / lib / defaults.c
index 71ccc73cc620cccbe757a8b8fcadf0084eb12be2..04b5fd36f350b494e3ab8e3ecba24b654fb0f422 100644 (file)
@@ -1,24 +1,13 @@
+// SPDX-License-Identifier: ISC
 /*
  * FRR switchable defaults.
  * Copyright (c) 2017-2019  David Lamparter, for NetDEF, Inc.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
 #include <zebra.h>
 
 #include "defaults.h"
-#include "version.h"
+#include "lib/version.h"
 
 static char df_version[128] = FRR_VER_SHORT, df_profile[128] = DFLT_NAME;
 static struct frr_default *dflt_first = NULL, **dflt_next = &dflt_first;
@@ -100,10 +89,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 +101,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 */