From: Donald Sharp Date: Wed, 20 May 2015 01:29:15 +0000 (-0700) Subject: isisd: isisd-warnings.patch X-Git-Tag: frr-2.0-rc1~1377 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=91283e76414a50cc72fcaf7f4d25b93ce924bd1d;p=matthieu%2Ffrr.git isisd: isisd-warnings.patch Remove compile warnings for the isisd directory Signed-off-by: Donald Sharp Reviewed-by: --- diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 3d9fb47390..4f7e2ce9ce 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -1342,7 +1342,6 @@ DEFUN (no_ipv6_router_isis, { struct interface *ifp; struct isis_area *area; - struct listnode *node; struct isis_circuit *circuit; ifp = (struct interface *) vty->index; diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h index 7ed481dc2e..d86fee040e 100644 --- a/isisd/isis_circuit.h +++ b/isisd/isis_circuit.h @@ -23,6 +23,8 @@ #ifndef ISIS_CIRCUIT_H #define ISIS_CIRCUIT_H +#include "vty.h" + #define CIRCUIT_MAX 255 struct password diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index e0208fa47f..e783293a06 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -1963,89 +1963,6 @@ process_psnp (int level, struct isis_circuit *circuit, u_char * ssnpa) return process_snp (ISIS_SNP_PSNP_FLAG, level, circuit, ssnpa); } -/* - * Process ISH - * ISO - 10589 - * Section 8.2.2 - Receiving ISH PDUs by an intermediate system - * FIXME: sample packet dump, need to figure 0x81 - looks like NLPid - * 0x82 0x15 0x01 0x00 0x04 0x01 0x2c 0x59 - * 0x38 0x08 0x47 0x00 0x01 0x00 0x02 0x00 - * 0x03 0x00 0x81 0x01 0xcc - */ -static int -process_is_hello (struct isis_circuit *circuit) -{ - struct isis_adjacency *adj; - int retval = ISIS_OK; - u_char neigh_len; - u_char *sysid; - - if (isis->debugs & DEBUG_ADJ_PACKETS) - { - zlog_debug ("ISIS-Adj (%s): Rcvd ISH on %s, cirType %s, cirID %u", - circuit->area->area_tag, circuit->interface->name, - circuit_t2string (circuit->is_type), circuit->circuit_id); - if (isis->debugs & DEBUG_PACKET_DUMP) - zlog_dump_data (STREAM_DATA (circuit->rcv_stream), - stream_get_endp (circuit->rcv_stream)); - } - - /* In this point in time we are not yet able to handle is_hellos - * on lan - Sorry juniper... - */ - if (circuit->circ_type == CIRCUIT_T_BROADCAST) - return retval; - - neigh_len = stream_getc (circuit->rcv_stream); - sysid = STREAM_PNT (circuit->rcv_stream) + neigh_len - 1 - ISIS_SYS_ID_LEN; - adj = circuit->u.p2p.neighbor; - if (!adj) - { - /* 8.2.2 */ - adj = isis_new_adj (sysid, NULL, 0, circuit); - if (adj == NULL) - return ISIS_ERROR; - - isis_adj_state_change (adj, ISIS_ADJ_INITIALIZING, NULL); - adj->sys_type = ISIS_SYSTYPE_UNKNOWN; - circuit->u.p2p.neighbor = adj; - } - /* 8.2.2 a) */ - if ((adj->adj_state == ISIS_ADJ_UP) && memcmp (adj->sysid, sysid, - ISIS_SYS_ID_LEN)) - { - /* 8.2.2 a) 1) FIXME: adjStateChange(down) event */ - /* 8.2.2 a) 2) delete the adj */ - XFREE (MTYPE_ISIS_ADJACENCY, adj); - /* 8.2.2 a) 3) create a new adj */ - adj = isis_new_adj (sysid, NULL, 0, circuit); - if (adj == NULL) - return ISIS_ERROR; - - /* 8.2.2 a) 3) i */ - isis_adj_state_change (adj, ISIS_ADJ_INITIALIZING, NULL); - /* 8.2.2 a) 3) ii */ - adj->sys_type = ISIS_SYSTYPE_UNKNOWN; - /* 8.2.2 a) 4) quite meaningless */ - } - /* 8.2.2 b) ignore on condition */ - if ((adj->adj_state == ISIS_ADJ_INITIALIZING) && - (adj->sys_type == ISIS_SYSTYPE_IS)) - { - /* do nothing */ - } - else - { - /* 8.2.2 c) respond with a p2p IIH */ - send_hello (circuit, 1); - } - /* 8.2.2 d) type is IS */ - adj->sys_type = ISIS_SYSTYPE_IS; - /* 8.2.2 e) FIXME: Circuit type of? */ - - return retval; -} - /* * PDU Dispatcher */ diff --git a/isisd/isis_pfpacket.c b/isisd/isis_pfpacket.c index 4bc8717a9b..d91d988858 100644 --- a/isisd/isis_pfpacket.c +++ b/isisd/isis_pfpacket.c @@ -323,7 +323,6 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level) /* we need to do the LLC in here because of P2P circuits, which will * not need it */ - int written = 1; struct sockaddr_ll sa; stream_set_getp (circuit->snd_stream, 0); @@ -356,7 +355,7 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level) iov[1].iov_base = circuit->snd_stream->data; iov[1].iov_len = stream_get_endp (circuit->snd_stream); - written = sendmsg (circuit->fd, &msg, 0); + sendmsg (circuit->fd, &msg, 0); return ISIS_OK; } @@ -364,7 +363,6 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level) int isis_send_pdu_p2p (struct isis_circuit *circuit, int level) { - int written = 1; struct sockaddr_ll sa; stream_set_getp (circuit->snd_stream, 0); @@ -381,10 +379,10 @@ isis_send_pdu_p2p (struct isis_circuit *circuit, int level) /* lets try correcting the protocol */ sa.sll_protocol = htons (0x00FE); - written = sendto (circuit->fd, circuit->snd_stream->data, - stream_get_endp (circuit->snd_stream), 0, - (struct sockaddr *) &sa, - sizeof (struct sockaddr_ll)); + sendto (circuit->fd, circuit->snd_stream->data, + stream_get_endp (circuit->snd_stream), 0, + (struct sockaddr *) &sa, + sizeof (struct sockaddr_ll)); return ISIS_OK; } diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index fd93efa659..0d2ebaf3bc 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1456,8 +1456,8 @@ isis_spf_schedule6 (struct isis_area *area, int level) assert (area->is_type & level); if (isis->debugs & DEBUG_SPF_EVENTS) - zlog_debug ("ISIS-Spf (%s) L%d SPF schedule called, lastrun %d sec ago", - area->area_tag, level, diff); + zlog_debug ("ISIS-Spf (%s) L%d SPF schedule called, lastrun %lld sec ago", + area->area_tag, level, (long long)diff); if (spftree->pending) return ISIS_OK; @@ -1476,8 +1476,8 @@ isis_spf_schedule6 (struct isis_area *area, int level) area->min_spf_interval[1] - diff); if (isis->debugs & DEBUG_SPF_EVENTS) - zlog_debug ("ISIS-Spf (%s) L%d SPF scheduled %d sec from now", - area->area_tag, level, area->min_spf_interval[level-1] - diff); + zlog_debug ("ISIS-Spf (%s) L%d SPF scheduled %lld sec from now", + area->area_tag, level, (long long)(area->min_spf_interval[level-1] - diff)); spftree->pending = 1; diff --git a/isisd/isis_tlv.c b/isisd/isis_tlv.c index bbfa5d812a..848cc6ee36 100644 --- a/isisd/isis_tlv.c +++ b/isisd/isis_tlv.c @@ -115,7 +115,6 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected, struct ipv6_reachability *ipv6_reach; int prefix_octets; #endif /* HAVE_IPV6 */ - u_char virtual; int value_len, retval = ISIS_OK; u_char *start = stream, *pnt = stream, *endpnt; @@ -179,7 +178,6 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected, * | Virtual Flag | * +-------+-------+-------+-------+-------+-------+-------+-------+ */ - virtual = *pnt; /* FIXME: what is the use for this? */ pnt++; value_len++; /* +-------+-------+-------+-------+-------+-------+-------+-------+ @@ -926,7 +924,6 @@ tlv_add_ip_addrs (struct list *ip_addrs, struct stream *stream) struct prefix_ipv4 *ipv4; u_char value[255]; u_char *pos = value; - int retval; for (ALL_LIST_ELEMENTS_RO (ip_addrs, node, ipv4)) { diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 8d457c462a..5522b378e1 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -321,7 +321,7 @@ isis_zebra_route_del_ipv4 (struct prefix *prefix, } #ifdef HAVE_IPV6 -void +static void isis_zebra_route_add_ipv6 (struct prefix *prefix, struct isis_route_info *route_info) { @@ -525,12 +525,9 @@ isis_zebra_read_ipv4 (int command, struct zclient *zclient, struct stream *stream; struct zapi_ipv4 api; struct prefix_ipv4 p; - unsigned long ifindex; - struct in_addr nexthop; stream = zclient->ibuf; memset (&p, 0, sizeof (struct prefix_ipv4)); - ifindex = 0; api.type = stream_getc (stream); api.instance = stream_getw (stream); @@ -544,12 +541,12 @@ isis_zebra_read_ipv4 (int command, struct zclient *zclient, if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) { api.nexthop_num = stream_getc (stream); - nexthop.s_addr = stream_get_ipv4 (stream); + (void)stream_get_ipv4 (stream); } if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) { api.ifindex_num = stream_getc (stream); - ifindex = stream_getl (stream); + stream_getl (stream); } if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) api.distance = stream_getc (stream); diff --git a/isisd/isisd.c b/isisd/isisd.c index 12b51e3b6b..5c90764855 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -1298,7 +1298,7 @@ DEFUN (show_isis_summary, vty_out_timestr(vty, spftree->last_run_timestamp); vty_out (vty, "%s", VTY_NEWLINE); - vty_out (vty, " last run duration : %u msec%s", + vty_out (vty, " last run duration : %ld msec%s", spftree->last_run_duration, VTY_NEWLINE); vty_out (vty, " run count : %d%s", diff --git a/isisd/isisd.h b/isisd/isisd.h index 5db485f472..5038d317bb 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -23,6 +23,8 @@ #ifndef ISISD_H #define ISISD_H +#include "vty.h" + #define ISISD_VERSION "0.0.7" /* uncomment if you are a developer in bug hunt */ diff --git a/isisd/topology/spgrid.c b/isisd/topology/spgrid.c index 611b672799..df09d0b2b6 100644 --- a/isisd/topology/spgrid.c +++ b/isisd/topology/spgrid.c @@ -50,8 +50,8 @@ long X, /* horizontal size of grid */ long x, y, - y1, y2, yp, - dl, dx, xn, yn, count, + ya1, y2, yp, + dl, dx, xn, yan, count, *mess; double n; @@ -670,11 +670,11 @@ gen_spgrid_topology (struct vty *vty, struct list *topology) for ( k = ax; k > 0; k -- ) { - y1 = nrand ( Y ); + ya1 = nrand ( Y ); do y2 = nrand ( Y ); - while ( y2 == y1 ); - i = NODE ( x, y1 ); + while ( y2 == ya1 ); + i = NODE ( x, ya1 ); j = NODE ( x, y2 ); l = am + nrand ( al ); print_arc (vty, topology, i, j, l ); @@ -712,12 +712,12 @@ gen_spgrid_topology (struct vty *vty, struct list *topology) if ( ip_f ) { yp = nrand(Y-y); - yn = mess[ yp ]; + yan = mess[ yp ]; mess[ yp ] = mess[ Y - y - 1 ]; } else - yn = y; - j = NODE ( xn, yn ); + yan = y; + j = NODE ( xn, yan ); l = im + nrand ( il ); if ( in != 0 ) l *= (long) ( in * dx );