From 82e1d7bc0324c5b3afed465c0746d37f7fc1b13b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 28 May 2008 09:50:36 -0700 Subject: Fix compiler warnings To eliminate compiler warnings * comment out unused code * fix printf formats * remove always true expression * initialize variables --- zebra/interface.c | 2 ++ zebra/irdp_packet.c | 2 +- zebra/rtadv.c | 4 +++- zebra/zebra_rib.c | 11 ++++++++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/zebra/interface.c b/zebra/interface.c index 1be55c31..916c58a6 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -833,6 +833,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) #endif /* HAVE_NET_RT_IFLIST */ } +#if 0 /* Check supported address family. */ static int if_supported_family (int family) @@ -845,6 +846,7 @@ if_supported_family (int family) #endif /* HAVE_IPV6 */ return 0; } +#endif /* Wrapper hook point for zebra daemon so that ifindex can be set * DEFUN macro not used as extract.pl HAS to ignore this diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c index 3c5f1559..ae121ea1 100644 --- a/zebra/irdp_packet.c +++ b/zebra/irdp_packet.c @@ -231,7 +231,7 @@ int irdp_read_raw(struct thread *r) struct zebra_if *zi; struct irdp_interface *irdp; char buf[IRDP_RX_BUF]; - int ret, ifindex; + int ret, ifindex = 0; int irdp_sock = THREAD_FD (r); t_irdp_raw = thread_add_read (zebrad.master, irdp_read_raw, NULL, irdp_sock); diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 4bdb83d5..0097e28f 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -90,11 +90,13 @@ rtadv_new (void) return new; } +#if 0 static void rtadv_free (struct rtadv *rtadv) { XFREE (MTYPE_TMP, rtadv); } +#endif static int rtadv_recv_packet (int sock, u_char *buf, int buflen, @@ -451,7 +453,7 @@ rtadv_read (struct thread *thread) int len; u_char buf[RTADV_MSG_SIZE]; struct sockaddr_in6 from; - unsigned int ifindex; + unsigned int ifindex = 0; int hoplimit = -1; sock = THREAD_FD (thread); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 5ae556bf..59b53fa1 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -93,6 +93,7 @@ vrf_alloc (const char *name) return vrf; } +#if 0 /* Free VRF. */ static void vrf_free (struct vrf *vrf) @@ -101,6 +102,7 @@ vrf_free (struct vrf *vrf) XFREE (MTYPE_VRF_NAME, vrf->name); XFREE (MTYPE_VRF, vrf); } +#endif /* Lookup VRF by identifier. */ struct vrf * @@ -109,6 +111,7 @@ vrf_lookup (u_int32_t id) return vector_lookup (vrf_vector, id); } +#if 0 /* Lookup VRF by name. */ static struct vrf * vrf_lookup_by_name (char *name) @@ -122,6 +125,7 @@ vrf_lookup_by_name (char *name) return vrf; return NULL; } +#endif /* Initialize VRF. */ static void @@ -911,8 +915,7 @@ nexthop_active_check (struct route_node *rn, struct rib *rib, return CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE); rmap = 0; - if (rib->type >= 0 && rib->type < ZEBRA_ROUTE_MAX && - proto_rm[family][rib->type]) + if (rib->type < ZEBRA_ROUTE_MAX && proto_rm[family][rib->type]) rmap = route_map_lookup_by_name (proto_rm[family][rib->type]); if (!rmap && proto_rm[family][ZEBRA_ROUTE_MAX]) rmap = route_map_lookup_by_name (proto_rm[family][ZEBRA_ROUTE_MAX]); @@ -1567,7 +1570,7 @@ void rib_dump (const char * func, const struct prefix_ipv4 * p, const struct rib zlog_debug ("%s: dumping RIB entry %p for %s/%d", func, rib, straddr1, p->prefixlen); zlog_debug ( - "%s: refcnt == %lu, uptime == %u, type == %u, table == %d", + "%s: refcnt == %lu, uptime == %lu, type == %u, table == %d", func, rib->refcnt, rib->uptime, @@ -2780,6 +2783,7 @@ rib_update (void) rib_queue_add (&zebrad, rn); } +#if 0 /* Interface goes up. */ static void rib_if_up (struct interface *ifp) @@ -2793,6 +2797,7 @@ rib_if_down (struct interface *ifp) { rib_update (); } +#endif /* Remove all routes which comes from non main table. */ static void -- cgit v1.2.3