From 264f864625263921936d5e2b3e1ae55c3a76a4f4 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 1 Apr 2017 08:42:19 -0400 Subject: [PATCH] isisd: Fix some various clang warnings Signed-off-by: Donald Sharp --- isisd/isis_pfpacket.c | 12 ++++++++---- isisd/isis_spf.c | 4 ---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/isisd/isis_pfpacket.c b/isisd/isis_pfpacket.c index 6ec7771ec2..dd07a9c6f5 100644 --- a/isisd/isis_pfpacket.c +++ b/isisd/isis_pfpacket.c @@ -279,6 +279,10 @@ isis_recv_pdu_bcast (struct isis_circuit *circuit, u_char * ssnpa) bytesread = recvfrom (circuit->fd, discard_buff, sizeof (discard_buff), MSG_DONTWAIT, (struct sockaddr *) &s_addr, (socklen_t *) &addr_len); + + if (bytesread < 0) + zlog_warn ("isis_recv_pdu_bcast(): recvfrom() failed"); + return ISIS_WARNING; } /* @@ -322,10 +326,10 @@ isis_recv_pdu_p2p (struct isis_circuit *circuit, u_char * ssnpa) addr_len = sizeof (s_addr); /* we can read directly to the stream */ - bytesread = stream_recvfrom (circuit->rcv_stream, circuit->fd, - circuit->interface->mtu, 0, - (struct sockaddr *) &s_addr, - (socklen_t *) &addr_len); + stream_recvfrom (circuit->rcv_stream, circuit->fd, + circuit->interface->mtu, 0, + (struct sockaddr *) &s_addr, + (socklen_t *) &addr_len); if (s_addr.sll_pkttype == PACKET_OUTGOING) { diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index db46078f20..554fa563ad 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -68,7 +68,6 @@ remove_excess_adjs (struct list *adjs) if (candidate->sys_type < adj->sys_type) { excess = node; - candidate = adj; continue; } if (candidate->sys_type > adj->sys_type) @@ -78,7 +77,6 @@ remove_excess_adjs (struct list *adjs) if (comp > 0) { excess = node; - candidate = adj; continue; } if (comp < 0) @@ -87,7 +85,6 @@ remove_excess_adjs (struct list *adjs) if (candidate->circuit->circuit_id > adj->circuit->circuit_id) { excess = node; - candidate = adj; continue; } @@ -98,7 +95,6 @@ remove_excess_adjs (struct list *adjs) if (comp > 0) { excess = node; - candidate = adj; continue; } } -- 2.39.5