Merge pull request #5746 from donaldsharp/bgp_sa

Coverioty sa stuff
This commit is contained in:
Russ White 2020-02-04 11:24:08 -05:00 committed by GitHub
commit c7a754408e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 8 deletions

View File

@ -10708,6 +10708,7 @@ DEFUN (show_ip_bgp_regexp,
if (argv_find(argv, argc, "REGEX", &idx))
regstr = argv[idx]->arg;
assert(regstr);
return bgp_show_regexp(vty, bgp, (const char *)regstr, afi, safi,
bgp_show_type_regexp, uj);
}

View File

@ -9593,8 +9593,7 @@ static void bgp_show_neighbor_graceful_restart_capability_per_afi_safi(
get_afi_safi_str(afi, safi, false));
vty_out(vty, " F bit : ");
} else
get_afi_safi_str(afi, safi, true);
}
if (peer->nsf[afi][safi]
&& CHECK_FLAG(peer->af_cap[afi][safi],

View File

@ -55,28 +55,42 @@ static int agentx_timeout(struct thread *t)
static int agentx_read(struct thread *t)
{
fd_set fds;
int flags;
int flags, new_flags = 0;
int nonblock = false;
struct listnode *ln = THREAD_ARG(t);
list_delete_node(events, ln);
/* fix for non blocking socket */
flags = fcntl(THREAD_FD(t), F_GETFL, 0);
if (-1 == flags)
if (-1 == flags) {
flog_err(EC_LIB_SYSTEM_CALL, "Failed to get FD settings fcntl: %s(%d)",
strerror(errno), errno);
return -1;
}
if (flags & O_NONBLOCK)
nonblock = true;
else
fcntl(THREAD_FD(t), F_SETFL, flags | O_NONBLOCK);
new_flags = fcntl(THREAD_FD(t), F_SETFL, flags | O_NONBLOCK);
if (new_flags == -1)
flog_err(EC_LIB_SYSTEM_CALL, "Failed to set snmp fd non blocking: %s(%d)",
strerror(errno), errno);
FD_ZERO(&fds);
FD_SET(THREAD_FD(t), &fds);
snmp_read(&fds);
/* Reset the flag */
if (!nonblock)
fcntl(THREAD_FD(t), F_SETFL, flags);
if (!nonblock) {
new_flags = fcntl(THREAD_FD(t), F_SETFL, flags);
if (new_flags == -1)
flog_err(
EC_LIB_SYSTEM_CALL,
"Failed to set snmp fd back to original settings: %s(%d)",
strerror(errno), errno);
}
netsnmp_check_outstanding_agent_requests();
agentx_events_update();

View File

@ -1489,7 +1489,7 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
* resolved by a route NH1. The exception is if the route is a
* host route.
*/
if (top && rn == top)
if (rn == top)
if (((afi == AFI_IP) && (rn->p.prefixlen != 32))
|| ((afi == AFI_IP6) && (rn->p.prefixlen != 128))) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)