summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-04-26 13:50:02 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-04-26 13:50:02 +0200
commitc05f73e0f4c1b40ebcf145e6001359667eeb2a6d (patch)
treec4dadbef75046d1e6da32c5637e9d5cf7c2c806b /lib
parentzebra: stop crash on process termination due to stale ifp->node (diff)
parentMerge pull request #345 from chiragshah6/pim_dev (diff)
downloadfrr-c05f73e0f4c1b40ebcf145e6001359667eeb2a6d.tar.xz
frr-c05f73e0f4c1b40ebcf145e6001359667eeb2a6d.zip
Merge remote-tracking branch 'origin/master' into mpls2
Diffstat (limited to 'lib')
-rw-r--r--lib/command_lex.l3
-rw-r--r--lib/distribute.c3
-rw-r--r--lib/pqueue.c8
-rw-r--r--lib/pqueue.h1
-rw-r--r--lib/privs.c1
-rw-r--r--lib/zclient.c32
6 files changed, 38 insertions, 10 deletions
diff --git a/lib/command_lex.l b/lib/command_lex.l
index deec1757c..c020d193a 100644
--- a/lib/command_lex.l
+++ b/lib/command_lex.l
@@ -23,6 +23,9 @@
*/
%{
+/* ignore harmless bug in old versions of flex */
+#pragma GCC diagnostic ignored "-Wsign-compare"
+
#include "command_parse.h"
#define YY_USER_ACTION yylloc->last_column += yyleng;
diff --git a/lib/distribute.c b/lib/distribute.c
index 01c338f17..f85994c9a 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -254,6 +254,7 @@ DEFUN (distribute_list,
distribute_list_cmd,
"distribute-list [prefix] WORD <in|out> [WORD]",
"Filter networks in routing updates\n"
+ "Specify a prefix\n"
"Access-list name\n"
"Filter incoming routing updates\n"
"Filter outgoing routing updates\n"
@@ -316,7 +317,9 @@ DEFUN (no_distribute_list,
no_distribute_list_cmd,
"no [ipv6] distribute-list [prefix] WORD <in|out> [WORD]",
NO_STR
+ "IPv6\n"
"Filter networks in routing updates\n"
+ "Specify a prefix\n"
"Access-list name\n"
"Filter incoming routing updates\n"
"Filter outgoing routing updates\n"
diff --git a/lib/pqueue.c b/lib/pqueue.c
index 0f870564d..fa502b462 100644
--- a/lib/pqueue.c
+++ b/lib/pqueue.c
@@ -188,3 +188,11 @@ pqueue_remove_at (int index, struct pqueue *queue)
trickle_down (index, queue);
}
}
+
+void
+pqueue_remove (void *data, struct pqueue *queue)
+{
+ for (int i = 0; i < queue->size; i++)
+ if (queue->array[i] == data)
+ pqueue_remove_at (i, queue);
+}
diff --git a/lib/pqueue.h b/lib/pqueue.h
index 8bb6961d8..b39fb92ee 100644
--- a/lib/pqueue.h
+++ b/lib/pqueue.h
@@ -39,6 +39,7 @@ extern void pqueue_delete (struct pqueue *queue);
extern void pqueue_enqueue (void *data, struct pqueue *queue);
extern void *pqueue_dequeue (struct pqueue *queue);
extern void pqueue_remove_at (int index, struct pqueue *queue);
+extern void pqueue_remove (void *data, struct pqueue *queue);
extern void trickle_down (int index, struct pqueue *queue);
extern void trickle_up (int index, struct pqueue *queue);
diff --git a/lib/privs.c b/lib/privs.c
index decd4bb7d..767ab667e 100644
--- a/lib/privs.c
+++ b/lib/privs.c
@@ -769,6 +769,7 @@ zprivs_init(struct zebra_privs_t *zprivs)
}
}
+ zprivs_state.zsuid = geteuid(); /* initial uid */
/* add groups only if we changed uid - otherwise skip */
if ((ngroups) && (zprivs_state.zsuid != zprivs_state.zuid))
{
diff --git a/lib/zclient.c b/lib/zclient.c
index 541a5444c..e3eadf22a 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1531,7 +1531,9 @@ lm_label_manager_connect (struct zclient *zclient)
vrf_id_t vrf_id;
u_int16_t cmd;
- zlog_debug ("Connecting to Label Manager");
+ if (zclient_debug)
+ zlog_debug ("Connecting to Label Manager");
+
if (zclient->sock < 0)
return -1;
@@ -1563,7 +1565,8 @@ lm_label_manager_connect (struct zclient *zclient)
zclient->sock = -1;
return -1;
}
- zlog_debug ("%s: Label manager connect request (%d bytes) sent", __func__, ret);
+ if (zclient_debug)
+ zlog_debug ("%s: Label manager connect request (%d bytes) sent", __func__, ret);
/* read response */
s = zclient->ibuf;
@@ -1577,8 +1580,9 @@ lm_label_manager_connect (struct zclient *zclient)
}
/* result */
result = stream_getc(s);
- zlog_debug ("%s: Label Manager connect response (%d bytes) received, result %u",
- __func__, size, result);
+ if (zclient_debug)
+ zlog_debug ("%s: Label Manager connect response (%d bytes) received, result %u",
+ __func__, size, result);
return (int)result;
}
@@ -1609,7 +1613,9 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
u_int16_t cmd;
u_char response_keep;
- zlog_debug ("Getting Label Chunk");
+ if (zclient_debug)
+ zlog_debug ("Getting Label Chunk");
+
if (zclient->sock < 0)
return -1;
@@ -1639,7 +1645,8 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
zclient->sock = -1;
return -1;
}
- zlog_debug ("%s: Label chunk request (%d bytes) sent", __func__, ret);
+ if (zclient_debug)
+ zlog_debug ("%s: Label chunk request (%d bytes) sent", __func__, ret);
/* read response */
s = zclient->ibuf;
@@ -1651,7 +1658,9 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
zlog_err ("%s: Invalid Get Label Chunk Message Reply Header", __func__);
return -1;
}
- zlog_debug ("%s: Label chunk response (%d bytes) received", __func__, size);
+ if (zclient_debug)
+ zlog_debug ("%s: Label chunk response (%d bytes) received", __func__, size);
+
/* keep */
response_keep = stream_getc(s);
/* start and end labels */
@@ -1672,8 +1681,9 @@ lm_get_label_chunk (struct zclient *zclient, u_char keep, uint32_t chunk_size,
return -1;
}
- zlog_debug ("Label Chunk assign: %u - %u (%u) ",
- *start, *end, response_keep);
+ if (zclient_debug)
+ zlog_debug ("Label Chunk assign: %u - %u (%u) ",
+ *start, *end, response_keep);
return 0;
}
@@ -1692,7 +1702,9 @@ lm_release_label_chunk (struct zclient *zclient, uint32_t start, uint32_t end)
int ret;
struct stream *s;
- zlog_debug ("Releasing Label Chunk");
+ if (zclient_debug)
+ zlog_debug ("Releasing Label Chunk");
+
if (zclient->sock < 0)
return -1;