summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-02-08 16:23:57 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2017-02-08 16:23:57 +0100
commit93f6b7dbfe0c2548b13cb23094dc766abb042128 (patch)
tree14b3cf139775d0ff8ba7cdd16db3b316c2d8e804
parente84aba82ab3ab5192eecaa4a210bf1fcf7aaceda (diff)
parentce45c9cc64360113f162dfed9923f7f02e5684e7 (diff)
Merge branch 'frr/pull/183' ("Coverity")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--bgpd/bgp_vty.c12
-rw-r--r--bgpd/rfapi/rfapi_ap.c2
-rw-r--r--bgpd/rfapi/vnc_zebra.c2
-rw-r--r--pimd/pim_cmd.c21
-rw-r--r--zebra/zebra_ptm.c8
5 files changed, 22 insertions, 23 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 51839b784b..01d1768691 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -7337,6 +7337,10 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
if (use_json)
json_neigh = json_object_new_object();
+ memset (dn_flag, '\0', sizeof (dn_flag));
+ if (!p->conf_if && peer_dynamic_neighbor (p))
+ dn_flag[0] = '*';
+
if (!use_json)
{
if (p->conf_if) /* Configured interface name. */
@@ -7344,13 +7348,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
BGP_PEER_SU_UNSPEC(p) ? "None" :
sockunion2str (&p->su, buf, SU_ADDRSTRLEN));
else /* Configured IP address. */
- {
- memset(dn_flag, '\0', sizeof(dn_flag));
- if (peer_dynamic_neighbor(p))
- dn_flag[0] = '*';
-
- vty_out (vty, "BGP neighbor is %s%s, ", dn_flag, p->host);
- }
+ vty_out (vty, "BGP neighbor is %s%s, ", dn_flag, p->host);
}
if (use_json)
diff --git a/bgpd/rfapi/rfapi_ap.c b/bgpd/rfapi/rfapi_ap.c
index 5cc1dd7815..68292c26b1 100644
--- a/bgpd/rfapi/rfapi_ap.c
+++ b/bgpd/rfapi/rfapi_ap.c
@@ -169,7 +169,7 @@ void
rfapiApReadvertiseAll (struct bgp *bgp, struct rfapi_descriptor *rfd)
{
struct rfapi_adb *adb;
- void *cursor;
+ void *cursor = NULL;
int rc;
for (rc =
diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c
index 85baa13301..23b6e9dbb4 100644
--- a/bgpd/rfapi/vnc_zebra.c
+++ b/bgpd/rfapi/vnc_zebra.c
@@ -546,6 +546,7 @@ vnc_zebra_route_msg (
api.nexthop_num = nhp_count;
api.nexthop = nhp_ary;
api.ifindex_num = 0;
+ api.instance = 0;
if (BGP_DEBUG (zebra, ZEBRA))
{
@@ -580,6 +581,7 @@ vnc_zebra_route_msg (
SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
api.ifindex_num = 1;
api.ifindex = &ifindex;
+ api.instance = 0;
if (BGP_DEBUG (zebra, ZEBRA))
{
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 7f276b22ce..ae23499d97 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -2876,6 +2876,13 @@ static void show_mroute(struct vty *vty, u_char uj)
json_object *json_ifp_out = NULL;
int found_oif = 0;
int first = 1;
+ char grp_str[INET_ADDRSTRLEN];
+ char src_str[INET_ADDRSTRLEN];
+ char in_ifname[INTERFACE_NAMSIZ+1];
+ char out_ifname[INTERFACE_NAMSIZ+1];
+ int oif_vif_index;
+ struct interface *ifp_in;
+ char proto[100];
if (uj) {
json = json_object_new_object();
@@ -2888,13 +2895,6 @@ static void show_mroute(struct vty *vty, u_char uj)
/* print list of PIM and IGMP routes */
for (ALL_LIST_ELEMENTS_RO(pim_channel_oil_list, node, c_oil)) {
- char grp_str[INET_ADDRSTRLEN];
- char src_str[INET_ADDRSTRLEN];
- char in_ifname[16];
- char out_ifname[16];
- int oif_vif_index;
- char proto[100];
- struct interface *ifp_in;
found_oif = 0;
first = 1;
if (!c_oil->installed && !uj)
@@ -3034,13 +3034,6 @@ static void show_mroute(struct vty *vty, u_char uj)
/* Print list of static routes */
for (ALL_LIST_ELEMENTS_RO(qpim_static_route_list, node, s_route)) {
- char grp_str[INET_ADDRSTRLEN];
- char src_str[INET_ADDRSTRLEN];
- char in_ifname[INTERFACE_NAMSIZ+1];
- char out_ifname[INTERFACE_NAMSIZ+1];
- int oif_vif_index;
- struct interface *ifp_in;
- char proto[100];
first = 1;
if (!s_route->c_oil.installed)
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index 446eb4953b..bc924842d4 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -388,7 +388,13 @@ zebra_ptm_socket_init (void)
if (sock < 0)
return -1;
if (set_nonblocking(sock) < 0)
- return -1;
+ {
+ if (IS_ZEBRA_DEBUG_EVENT)
+ zlog_debug ("%s: Unable to set socket non blocking[%s]",
+ __PRETTY_FUNCTION__, safe_strerror (errno));
+ close (sock);
+ return -1;
+ }
/* Make server socket. */
memset (&addr, 0, sizeof (struct sockaddr_un));