summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/command.c7
-rw-r--r--lib/command.h2
-rw-r--r--lib/command_graph.c2
-rw-r--r--lib/command_lex.l3
-rw-r--r--lib/defun_lex.l3
-rw-r--r--lib/mpls.h15
-rw-r--r--lib/prefix.h6
-rw-r--r--lib/ptm_lib.c4
-rw-r--r--lib/spf_backoff.c2
-rw-r--r--lib/vty.c2
-rw-r--r--lib/zclient.c4
11 files changed, 25 insertions, 25 deletions
diff --git a/lib/command.c b/lib/command.c
index 83c91c4c60..d17f2c3d48 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -96,7 +96,6 @@ const char *node_names[] = {
"ldp l2vpn", // LDP_L2VPN_NODE,
"ldp", // LDP_PSEUDOWIRE_NODE,
"isis", // ISIS_NODE,
- "pim", // PIM_NODE,
"masc", // MASC_NODE,
"irdp", // IRDP_NODE,
"static ip", // IP_NODE,
@@ -1308,7 +1307,6 @@ void cmd_exit(struct vty *vty)
case KEYCHAIN_NODE:
case MASC_NODE:
case RMAP_NODE:
- case PIM_NODE:
case VTY_NODE:
vty->node = CONFIG_NODE;
break;
@@ -1414,7 +1412,6 @@ DEFUN (config_end,
case KEYCHAIN_NODE:
case KEYCHAIN_KEY_NODE:
case MASC_NODE:
- case PIM_NODE:
case VTY_NODE:
case LINK_PARAMS_NODE:
vty_config_unlock(vty);
@@ -1865,7 +1862,7 @@ DEFUN (config_password,
return CMD_SUCCESS;
}
- if (!isalnum(argv[idx_8]->arg[0])) {
+ if (!isalnum((int)argv[idx_8]->arg[0])) {
vty_out(vty,
"Please specify string starting with alphanumeric\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1917,7 +1914,7 @@ DEFUN (config_enable_password,
}
}
- if (!isalnum(argv[idx_8]->arg[0])) {
+ if (!isalnum((int)argv[idx_8]->arg[0])) {
vty_out(vty,
"Please specify string starting with alphanumeric\n");
return CMD_WARNING_CONFIG_FAILED;
diff --git a/lib/command.h b/lib/command.h
index fa8323bf2d..e1edc1ef32 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -119,7 +119,6 @@ enum node_type {
LDP_L2VPN_NODE, /* LDP L2VPN node */
LDP_PSEUDOWIRE_NODE, /* LDP Pseudowire node */
ISIS_NODE, /* ISIS protocol mode */
- PIM_NODE, /* PIM protocol mode */
MASC_NODE, /* MASC for multicast. */
IRDP_NODE, /* ICMP Router Discovery Protocol mode. */
IP_NODE, /* Static ip route node. */
@@ -358,6 +357,7 @@ struct cmd_node {
#define OSPF_RI_STR "OSPF Router Information specific commands\n"
#define PCE_STR "PCE Router Information specific commands\n"
#define MPLS_STR "MPLS information\n"
+#define SR_STR "Segment-Routing specific commands\n"
#define WATCHFRR_STR "watchfrr information\n"
#define ZEBRA_STR "Zebra information\n"
diff --git a/lib/command_graph.c b/lib/command_graph.c
index fce11a70cc..f00b126536 100644
--- a/lib/command_graph.c
+++ b/lib/command_graph.c
@@ -97,7 +97,7 @@ void cmd_token_varname_set(struct cmd_token *token, const char *varname)
token->varname[i] = '_';
break;
default:
- token->varname[i] = tolower(varname[i]);
+ token->varname[i] = tolower((int)varname[i]);
}
token->varname[len] = '\0';
}
diff --git a/lib/command_lex.l b/lib/command_lex.l
index 436f3a241d..530900659b 100644
--- a/lib/command_lex.l
+++ b/lib/command_lex.l
@@ -23,8 +23,9 @@
*/
%{
-/* ignore harmless bug in old versions of flex */
+/* ignore harmless bugs in old versions of flex */
#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wmissing-prototypes"
#include "command_parse.h"
diff --git a/lib/defun_lex.l b/lib/defun_lex.l
index 024445be63..87775a0e75 100644
--- a/lib/defun_lex.l
+++ b/lib/defun_lex.l
@@ -34,8 +34,9 @@
* code documentation in it.
*/
-/* ignore harmless bug in old versions of flex */
+/* ignore harmless bugs in old versions of flex */
#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wunused-value"
#include "config.h"
#include <Python.h>
diff --git a/lib/mpls.h b/lib/mpls.h
index 6ef00375e8..95882c26ec 100644
--- a/lib/mpls.h
+++ b/lib/mpls.h
@@ -41,8 +41,16 @@
#define MPLS_MAX_UNRESERVED_LABEL 1048575
/* Default min and max SRGB label range */
-#define MPLS_DEFAULT_MIN_SRGB_LABEL 16000
-#define MPLS_DEFAULT_MAX_SRGB_LABEL 23999
+/* Even if the SRGB allows to manage different Label space between routers,
+ * if an operator want to use the same SRGB for all its router, we must fix
+ * a common range. However, Cisco start its SRGB at 16000 and Juniper ends
+ * its SRGB at 16384 for OSPF. Thus, by fixing the minimum SRGB label to
+ * 8000 we could deal with both Cisco and Juniper.
+ */
+#define MPLS_DEFAULT_MIN_SRGB_LABEL 8000
+#define MPLS_DEFAULT_MAX_SRGB_LABEL 50000
+#define MPLS_DEFAULT_MIN_SRGB_SIZE 5000
+#define MPLS_DEFAULT_MAX_SRGB_SIZE 20000
/* Maximum # labels that can be pushed. */
#define MPLS_MAX_LABELS 16
@@ -100,7 +108,8 @@ enum lsp_types_t {
ZEBRA_LSP_NONE = 0, /* No LSP. */
ZEBRA_LSP_STATIC = 1, /* Static LSP. */
ZEBRA_LSP_LDP = 2, /* LDP LSP. */
- ZEBRA_LSP_BGP = 3 /* BGP LSP. */
+ ZEBRA_LSP_BGP = 3, /* BGP LSP. */
+ ZEBRA_LSP_SR = 4 /* Segment Routing LSP. */
};
/* Functions for basic label operations. */
diff --git a/lib/prefix.h b/lib/prefix.h
index 7e947ea48a..bcc2230607 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -39,12 +39,6 @@
#define ETH_ALEN 6
#endif
-/* for compatibility */
-#ifdef ETHER_ADDR_LEN
-#undef ETHER_ADDR_LEN
-#endif
-#define ETHER_ADDR_LEN 6 CPP_WARN("ETHER_ADDR_LEN is being replaced by ETH_ALEN.\\n")
-
#define ETHER_ADDR_STRLEN (3*ETH_ALEN)
/*
* there isn't a portable ethernet address type. We define our
diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c
index 28d26149e5..fea5a8cc40 100644
--- a/lib/ptm_lib.c
+++ b/lib/ptm_lib.c
@@ -120,7 +120,7 @@ static int _ptm_lib_decode_header(csv_t *csv, int *msglen, int *version,
}
/* remove leading spaces */
for (i = j = 0; i < csv_field_len(fld); i++) {
- if (!isspace(hdr[i])) {
+ if (!isspace((int)hdr[i])) {
client_name[j] = hdr[i];
j++;
}
@@ -347,7 +347,7 @@ int ptm_lib_process_msg(ptm_lib_handle_t *hdl, int fd, char *inbuf, int inlen,
{
int rc, len;
char client_name[32];
- int cmd_id, type, ver, msglen;
+ int cmd_id = 0, type = 0, ver = 0, msglen = 0;
csv_t *csv;
ptm_lib_msg_ctxt_t *p_ctxt = NULL;
diff --git a/lib/spf_backoff.c b/lib/spf_backoff.c
index 92b7620eda..d7907fafdf 100644
--- a/lib/spf_backoff.c
+++ b/lib/spf_backoff.c
@@ -205,7 +205,7 @@ static const char *timeval_format(struct timeval *tv)
size_t offset = strlen(timebuf);
snprintf(timebuf + offset, sizeof(timebuf) - offset, ".%ld",
- tv->tv_usec);
+ (long int)tv->tv_usec);
return timebuf;
}
diff --git a/lib/vty.c b/lib/vty.c
index 4026e0cf8a..43a53b7732 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -732,7 +732,6 @@ static void vty_end_config(struct vty *vty)
case KEYCHAIN_NODE:
case KEYCHAIN_KEY_NODE:
case MASC_NODE:
- case PIM_NODE:
case VTY_NODE:
case BGP_EVPN_VNI_NODE:
vty_config_unlock(vty);
@@ -1130,7 +1129,6 @@ static void vty_stop_input(struct vty *vty)
case KEYCHAIN_NODE:
case KEYCHAIN_KEY_NODE:
case MASC_NODE:
- case PIM_NODE:
case VTY_NODE:
vty_config_unlock(vty);
vty->node = ENABLE_NODE;
diff --git a/lib/zclient.c b/lib/zclient.c
index d3717d0cdd..4d5b0f211d 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -976,7 +976,7 @@ int zapi_route_encode(u_char cmd, struct stream *s, struct zapi_route *api)
stream_putw(s, api->nexthop_num);
if (api->nexthop_num)
- stream_putw(s, api->nh_vrf_id);
+ stream_putl(s, api->nh_vrf_id);
for (i = 0; i < api->nexthop_num; i++) {
api_nh = &api->nexthops[i];
@@ -1127,7 +1127,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
}
if (api->nexthop_num)
- STREAM_GETW(s, api->nh_vrf_id);
+ STREAM_GETL(s, api->nh_vrf_id);
for (i = 0; i < api->nexthop_num; i++) {
api_nh = &api->nexthops[i];