summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_ecommunity.c11
-rw-r--r--bgpd/bgp_ecommunity.h10
-rw-r--r--bgpd/bgp_evpn_vty.c11
-rw-r--r--bgpd/bgp_nexthop.c6
-rw-r--r--ldpd/lde.c8
-rw-r--r--ldpd/ldp_debug.c12
-rw-r--r--ldpd/ldp_debug.h9
-rw-r--r--ldpd/ldp_vty_cmds.c3
-rw-r--r--ldpd/ldpd.c2
9 files changed, 48 insertions, 24 deletions
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index 897b1c7508..bdcc12705c 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -555,15 +555,8 @@ static int ecommunity_rt_soo_str(char *buf, u_int8_t *pnt, int type,
const char *prefix;
/* For parse Extended Community attribute tupple. */
- struct ecommunity_as {
- as_t as;
- u_int32_t val;
- } eas;
-
- struct ecommunity_ip {
- struct in_addr ip;
- u_int16_t val;
- } eip;
+ struct ecommunity_as eas;
+ struct ecommunity_ip eip;
/* Determine prefix for string, if any. */
diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h
index 927b1370cf..c967f8bd47 100644
--- a/bgpd/bgp_ecommunity.h
+++ b/bgpd/bgp_ecommunity.h
@@ -70,6 +70,16 @@ struct ecommunity {
char *str;
};
+struct ecommunity_as {
+ as_t as;
+ uint32_t val;
+};
+
+struct ecommunity_ip {
+ struct in_addr ip;
+ uint16_t val;
+};
+
/* Extended community value is eight octet. */
struct ecommunity_val {
char val[ECOMMUNITY_SIZE];
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index 528efd2277..c05e313298 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -35,6 +35,7 @@
#include "bgpd/bgp_evpn_private.h"
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_vty.h"
+#include "bgpd/bgp_ecommunity.h"
#define SHOW_DISPLAY_STANDARD 0
#define SHOW_DISPLAY_TAGS 1
@@ -57,14 +58,8 @@ static void display_import_rt(struct vty *vty, struct irt_node *irt,
{
u_char *pnt;
u_char type, sub_type;
- struct ecommunity_as {
- as_t as;
- u_int32_t val;
- } eas;
- struct ecommunity_ip {
- struct in_addr ip;
- u_int16_t val;
- } eip;
+ struct ecommunity_as eas;
+ struct ecommunity_ip eip;
struct listnode *node, *nnode;
struct bgpevpn *tmp_vpn;
json_object *json_rt = NULL;
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 1200d74d6a..8c08fe4c8f 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -580,7 +580,11 @@ DEFUN (show_ip_bgp_nexthop,
"Show detailed information\n")
{
int idx = 0;
- char *vrf = argv_find(argv, argc, "WORD", &idx) ? argv[idx]->arg : NULL;
+ char *vrf = NULL;
+
+ if (argv_find(argv, argc, "view", &idx)
+ || argv_find(argv, argc, "vrf", &idx))
+ vrf = argv[++idx]->arg;
int detail = argv_find(argv, argc, "detail", &idx) ? 1 : 0;
return show_ip_bgp_nexthop_table(vty, vrf, detail);
}
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 4460b424d2..3482f3d722 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -1609,7 +1609,6 @@ static void
zclient_sync_init(u_short instance)
{
/* Initialize special zclient for synchronous message exchanges. */
- log_debug("Initializing synchronous zclient for label manager");
zclient_sync = zclient_new(master);
zclient_sync->sock = -1;
zclient_sync->redist_default = ZEBRA_ROUTE_LDP;
@@ -1640,7 +1639,7 @@ lde_get_label_chunk(void)
int ret;
uint32_t start, end;
- log_debug("Getting label chunk");
+ debug_labels("getting label chunk (size %u)", CHUNK_SIZE);
ret = lm_get_label_chunk(zclient_sync, 0, CHUNK_SIZE, &start, &end);
if (ret < 0) {
log_warnx("Error getting label chunk!");
@@ -1670,7 +1669,7 @@ on_get_label_chunk_response(uint32_t start, uint32_t end)
{
struct label_chunk *new_label_chunk;
- log_debug("Label Chunk assign: %u - %u", start, end);
+ debug_labels("label chunk assign: %u - %u", start, end);
new_label_chunk = calloc(1, sizeof(struct label_chunk));
if (!new_label_chunk) {
@@ -1693,7 +1692,8 @@ static uint32_t
lde_get_next_label(void)
{
struct label_chunk *label_chunk;
- uint32_t i, pos, size;
+ uint32_t i, size;
+ uint64_t pos;
uint32_t label = NO_LABEL;
while (current_label_chunk) {
diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c
index d80ec8dfbc..ee4f0843b7 100644
--- a/ldpd/ldp_debug.c
+++ b/ldpd/ldp_debug.c
@@ -66,6 +66,11 @@ ldp_vty_debug(struct vty *vty, const char *negate, const char *type_str,
DEBUG_OFF(event, EVENT);
else
DEBUG_ON(event, EVENT);
+ } else if (strcmp(type_str, "labels") == 0) {
+ if (negate)
+ DEBUG_OFF(labels, LABELS);
+ else
+ DEBUG_ON(labels, LABELS);
} else if (strcmp(type_str, "messages") == 0) {
if (dir_str == NULL)
return (CMD_WARNING_CONFIG_FAILED);
@@ -115,6 +120,8 @@ ldp_vty_show_debugging(struct vty *vty)
vty_out (vty, " LDP errors debugging is on\n");
if (LDP_DEBUG(event, EVENT))
vty_out (vty, " LDP events debugging is on\n");
+ if (LDP_DEBUG(labels, LABELS))
+ vty_out (vty, " LDP labels debugging is on\n");
if (LDP_DEBUG(msg, MSG_RECV_ALL))
vty_out (vty,
" LDP detailed messages debugging is on (inbound)\n");
@@ -157,6 +164,11 @@ ldp_debug_config_write(struct vty *vty)
write = 1;
}
+ if (CONF_LDP_DEBUG(labels, LABELS)) {
+ vty_out (vty, "debug mpls ldp labels\n");
+ write = 1;
+ }
+
if (CONF_LDP_DEBUG(msg, MSG_RECV_ALL)) {
vty_out (vty, "debug mpls ldp messages recv all\n");
write = 1;
diff --git a/ldpd/ldp_debug.h b/ldpd/ldp_debug.h
index 4b91656851..a0972cea8e 100644
--- a/ldpd/ldp_debug.h
+++ b/ldpd/ldp_debug.h
@@ -31,6 +31,9 @@ struct ldp_debug {
int event;
#define LDP_DEBUG_EVENT 0x01
+ int labels;
+#define LDP_DEBUG_LABELS 0x01
+
int msg;
#define LDP_DEBUG_MSG_RECV 0x01
#define LDP_DEBUG_MSG_RECV_ALL 0x02
@@ -90,6 +93,12 @@ do { \
log_debug("event: " emsg, __VA_ARGS__); \
} while (0)
+#define debug_labels(emsg, ...) \
+do { \
+ if (LDP_DEBUG(labels, LABELS)) \
+ log_debug("labels: " emsg, __VA_ARGS__); \
+} while (0)
+
#define debug_msg_recv(emsg, ...) \
do { \
if (LDP_DEBUG(msg, MSG_RECV)) \
diff --git a/ldpd/ldp_vty_cmds.c b/ldpd/ldp_vty_cmds.c
index be473063cd..cd92958d4c 100644
--- a/ldpd/ldp_vty_cmds.c
+++ b/ldpd/ldp_vty_cmds.c
@@ -538,13 +538,14 @@ DEFPY (ldp_debug_mpls_ldp_discovery_hello,
DEFPY (ldp_debug_mpls_ldp_type,
ldp_debug_mpls_ldp_type_cmd,
- "[no] debug mpls ldp <errors|event|zebra>$type",
+ "[no] debug mpls ldp <errors|event|labels|zebra>$type",
NO_STR
"Debugging functions\n"
"MPLS information\n"
"Label Distribution Protocol\n"
"Errors\n"
"LDP event information\n"
+ "LDP label allocation information\n"
"LDP zebra information\n")
{
return (ldp_vty_debug(vty, no, type, NULL, NULL));
diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c
index 0a586ec1c5..d31c575920 100644
--- a/ldpd/ldpd.c
+++ b/ldpd/ldpd.c
@@ -370,9 +370,9 @@ main(int argc, char *argv[])
if (main_imsg_send_ipc_sockets(&iev_ldpe->ibuf, &iev_lde->ibuf))
fatal("could not establish imsg links");
- main_imsg_compose_both(IMSG_INIT, &init, sizeof(init));
main_imsg_compose_both(IMSG_DEBUG_UPDATE, &ldp_debug,
sizeof(ldp_debug));
+ main_imsg_compose_both(IMSG_INIT, &init, sizeof(init));
main_imsg_send_config(ldpd_conf);
if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED)