summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:29:14 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:29:14 +0200
commited2eb093c75183167524205111fb4ae3e253e4a9 (patch)
tree5e6cc1fb8b9b49374c2e430c4d3e9507ac2e9d83
parentripd: ripd-warnings.patch (diff)
downloadfrr-ed2eb093c75183167524205111fb4ae3e253e4a9.tar.xz
frr-ed2eb093c75183167524205111fb4ae3e253e4a9.zip
ospfd: ospfd-warnings.patch
Remove compile warnings for the ospfd/ospf6d directory Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by:
-rw-r--r--ospf6d/ospf6_area.c2
-rw-r--r--ospf6d/ospf6_asbr.c7
-rw-r--r--ospf6d/ospf6_flood.c2
-rw-r--r--ospf6d/ospf6_interface.c1
-rw-r--r--ospf6d/ospf6_lsa.c4
-rw-r--r--ospf6d/ospf6_neighbor.h2
-rw-r--r--ospf6d/ospf6_network.c2
-rw-r--r--ospf6d/ospf6_route.c2
-rw-r--r--ospf6d/ospf6_route.h8
-rw-r--r--ospf6d/ospf6_spf.c11
-rw-r--r--ospf6d/ospf6_top.c19
-rw-r--r--ospfd/ospf_api.c8
-rw-r--r--ospfd/ospf_ase.c2
-rw-r--r--ospfd/ospf_dump.c2
-rw-r--r--ospfd/ospf_flood.c1
-rw-r--r--ospfd/ospf_packet.c7
-rw-r--r--ospfd/ospf_routemap.c22
-rw-r--r--ospfd/ospf_spf.c1
-rw-r--r--ospfd/ospf_zebra.c3
-rw-r--r--ospfd/ospfd.c2
20 files changed, 36 insertions, 72 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index ac2fc378b..71787541e 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -676,13 +676,11 @@ DEFUN (no_area_filter_list,
"Filter networks sent from this area\n")
{
struct ospf6_area *area;
- struct prefix_list *plist;
OSPF6_CMD_AREA_GET (argv[0], area);
argc--;
argv++;
- plist = prefix_list_lookup (AFI_IP6, argv[0]);
if (strncmp (argv[1], "in", 2) == 0)
{
if (PREFIX_NAME_IN (area))
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index b39bfdc49..9f5337cc6 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -58,18 +58,13 @@ ospf6_as_external_lsa_originate (struct ospf6_route *route)
{
char buffer[OSPF6_MAX_LSASIZE];
struct ospf6_lsa_header *lsa_header;
- struct ospf6_lsa *old, *lsa;
+ struct ospf6_lsa *lsa;
struct ospf6_external_info *info = route->route_option;
struct ospf6_as_external_lsa *as_external_lsa;
char buf[64];
caddr_t p;
- /* find previous LSA */
- old = ospf6_lsdb_lookup (htons (OSPF6_LSTYPE_AS_EXTERNAL),
- route->path.origin.id, ospf6->router_id,
- ospf6->lsdb);
-
if (IS_OSPF6_DEBUG_ASBR || IS_OSPF6_DEBUG_ORIGINATE (AS_EXTERNAL))
{
prefix2str (&route->prefix, buf, sizeof (buf));
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index b17406f24..14c16c024 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -760,7 +760,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from,
struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
int ismore_recent;
int is_debug = 0;
- int time_delta_ms;
+ unsigned int time_delta_ms;
ismore_recent = 1;
assert (from);
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 3d06ce390..5043be435 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -1295,7 +1295,6 @@ DEFUN (no_ipv6_ospf6_cost,
{
struct ospf6_interface *oi;
struct interface *ifp;
- unsigned long int lcost;
ifp = (struct interface *) vty->index;
assert (ifp);
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 2e6153557..4a4fa0f9f 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -493,8 +493,8 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa)
vty_out (vty, "Flag: %x %s", lsa->flag, VNL);
vty_out (vty, "Lock: %d %s", lsa->lock, VNL);
vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL);
- vty_out (vty, "Threads: Expire: %x, Refresh: %x %s",
- lsa->expire, lsa->refresh, VNL);
+ vty_out (vty, "Threads: Expire: %llx, Refresh: %llx %s",
+ (unsigned long long)lsa->expire, (unsigned long long)lsa->refresh, VNL);
vty_out (vty, "%s", VNL);
return;
}
diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h
index 65c43fd2e..cba2cb99d 100644
--- a/ospf6d/ospf6_neighbor.h
+++ b/ospf6d/ospf6_neighbor.h
@@ -137,7 +137,7 @@ static const char *ospf6_neighbor_event_str[] =
"InactivityTimer",
};
-static const char *ospf6_neighbor_event_string (int event)
+static inline const char *ospf6_neighbor_event_string (int event)
{
#define OSPF6_NEIGHBOR_UNKNOWN_EVENT_STRING "UnknownEvent"
diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c
index 954c1f6f2..0d53d3ee7 100644
--- a/ospf6d/ospf6_network.c
+++ b/ospf6d/ospf6_network.c
@@ -64,7 +64,7 @@ ospf6_set_pktinfo (void)
setsockopt_ipv6_pktinfo (ospf6_sock, 1);
}
-void
+static void
ospf6_set_transport_class (void)
{
#ifdef IPTOS_PREC_INTERNETCONTROL
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 4ef5b7c2f..38fc0c505 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -375,7 +375,7 @@ ospf6_route_get_first_nh_index (struct ospf6_route *route)
if (route)
{
- if (nh = (struct ospf6_nexthop *)listhead (route->nh_list))
+ if ((nh = (struct ospf6_nexthop *)listhead (route->nh_list)))
return (nh->ifindex);
}
diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h
index b0e43874a..e5bfc5ed0 100644
--- a/ospf6d/ospf6_route.h
+++ b/ospf6d/ospf6_route.h
@@ -248,14 +248,12 @@ extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
#define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))
#define ospf6_linkstate_prefix_adv_router(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0]))
+ ((x)->u.prefix4.s_addr)
#define ospf6_linkstate_prefix_id(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4]))
+ ((x)->u.prefix6.s6_addr32[1])
#define ADV_ROUTER_IN_PREFIX(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0]))
-#define ID_IN_PREFIX(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4]))
+ ((x)->u.prefix4.s_addr)
/* Function prototype */
extern void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id,
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 3713c5151..02fd14b76 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -61,7 +61,7 @@ ospf6_spf_merge_nexthops_to_route (struct ospf6_route *rt,
ospf6_merge_nexthops (rt->nh_list, v->nh_list);
}
-static int
+static unsigned int
ospf6_spf_get_ifindex_from_nh (struct ospf6_vertex *v)
{
struct ospf6_nexthop *nh;
@@ -77,7 +77,7 @@ ospf6_spf_get_ifindex_from_nh (struct ospf6_vertex *v)
return (nh->ifindex);
}
}
- return -1;
+ return 0;
}
static int
@@ -264,7 +264,7 @@ ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v,
caddr_t lsdesc)
{
int i;
- int ifindex;
+ unsigned int ifindex;
struct ospf6_interface *oi;
u_int16_t type;
u_int32_t adv_router;
@@ -275,7 +275,7 @@ ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v,
assert (VERTEX_IS_TYPE (ROUTER, w));
ifindex = (VERTEX_IS_TYPE (NETWORK, v) ? ospf6_spf_get_ifindex_from_nh (v) :
ROUTER_LSDESC_GET_IFID (lsdesc));
- if (ifindex == -1)
+ if (ifindex == 0)
{
zlog_err ("No nexthop ifindex at vertex %s", v->name);
return;
@@ -436,7 +436,7 @@ static const char *ospf6_spf_reason_str[] =
void ospf6_spf_reason_string (unsigned int reason, char *buf, int size)
{
- int bit;
+ unsigned int bit;
int len = 0;
if (!buf)
@@ -594,7 +594,6 @@ ospf6_spf_calculation_thread (struct thread *t)
struct ospf6 *ospf6;
struct timeval start, end, runtime;
struct listnode *node;
- struct ospf6_route *route;
int areas_processed = 0;
char rbuf[32];
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 424902fff..c90c0a07d 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -185,20 +185,6 @@ ospf6_delete (struct ospf6 *o)
}
static void
-ospf6_enable (struct ospf6 *o)
-{
- struct listnode *node, *nnode;
- struct ospf6_area *oa;
-
- if (CHECK_FLAG (o->flag, OSPF6_DISABLED))
- {
- UNSET_FLAG (o->flag, OSPF6_DISABLED);
- for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa))
- ospf6_area_enable (oa);
- }
-}
-
-static void
ospf6_disable (struct ospf6 *o)
{
struct listnode *node, *nnode;
@@ -224,7 +210,7 @@ ospf6_disable (struct ospf6 *o)
}
}
-int
+static int
ospf6_maxage_remover (struct thread *thread)
{
struct ospf6 *o = (struct ospf6 *) THREAD_ARG (thread);
@@ -540,14 +526,11 @@ DEFUN (no_ospf6_interface_area,
"OSPF6 area ID in IPv4 address notation\n"
)
{
- struct ospf6 *o;
struct ospf6_interface *oi;
struct ospf6_area *oa;
struct interface *ifp;
u_int32_t area_id;
- o = (struct ospf6 *) vty->index;
-
ifp = if_lookup_by_name (argv[0]);
if (ifp == NULL)
{
diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c
index fae942ec2..45525f4a2 100644
--- a/ospfd/ospf_api.c
+++ b/ospfd/ospf_api.c
@@ -464,7 +464,7 @@ new_msg_register_event (u_int32_t seqnum, struct lsa_filter_type *filter)
{
u_char buf[OSPF_API_MAX_MSG_SIZE];
struct msg_register_event *emsg;
- int len;
+ unsigned int len;
emsg = (struct msg_register_event *) buf;
len = sizeof (struct msg_register_event) +
@@ -483,7 +483,7 @@ new_msg_sync_lsdb (u_int32_t seqnum, struct lsa_filter_type *filter)
{
u_char buf[OSPF_API_MAX_MSG_SIZE];
struct msg_sync_lsdb *smsg;
- int len;
+ unsigned int len;
smsg = (struct msg_sync_lsdb *) buf;
len = sizeof (struct msg_sync_lsdb) +
@@ -504,7 +504,7 @@ new_msg_originate_request (u_int32_t seqnum,
struct in_addr area_id, struct lsa_header *data)
{
struct msg_originate_request *omsg;
- int omsglen;
+ unsigned int omsglen;
char buf[OSPF_API_MAX_MSG_SIZE];
omsg = (struct msg_originate_request *) buf;
@@ -630,7 +630,7 @@ new_msg_lsa_change_notify (u_char msgtype,
{
u_char buf[OSPF_API_MAX_MSG_SIZE];
struct msg_lsa_change_notify *nmsg;
- int len;
+ unsigned int len;
assert (data);
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 9038b3a5c..8aedc8088 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -679,7 +679,7 @@ ospf_ase_calculate_timer (struct thread *t)
quagga_gettime(QUAGGA_CLK_MONOTONIC, &stop_time);
- zlog_info ("SPF Processing Time(usecs): External Routes: %d\n",
+ zlog_info ("SPF Processing Time(usecs): External Routes: %ld\n",
(stop_time.tv_sec - start_time.tv_sec)*1000000L+
(stop_time.tv_usec - start_time.tv_usec));
}
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index af5cbf534..9c73e1b2b 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -2081,8 +2081,6 @@ config_write_debug (struct vty *vty)
if (ospf->instance)
sprintf(str, " %d", ospf->instance);
- else
- sprintf(str, "");
/* debug ospf ism (status|events|timers). */
if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c
index 9ab46b9c9..36fc4650e 100644
--- a/ospfd/ospf_flood.c
+++ b/ospfd/ospf_flood.c
@@ -108,6 +108,7 @@ ospf_external_info_check (struct ospf_lsa *lsa)
for (ALL_LIST_ELEMENTS_RO(ext_list, node, ext))
{
+ rn = NULL;
if (ext->external_info)
rn = route_node_lookup (ext->external_info,
(struct prefix *) &p);
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 44ee806e3..ee1e99250 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -217,13 +217,6 @@ ospf_fifo_flush (struct ospf_fifo *fifo)
fifo->count = 0;
}
-/* Return the current fifo count */
-static int
-ospf_fifo_count (struct ospf_fifo *fifo)
-{
- return (fifo->count);
-}
-
/* Free ospf packet fifo. */
void
ospf_fifo_free (struct ospf_fifo *fifo)
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c
index 6e02de3a1..b2f1c6712 100644
--- a/ospfd/ospf_routemap.c
+++ b/ospfd/ospf_routemap.c
@@ -45,7 +45,6 @@ ospf_route_map_update (const char *name)
{
struct ospf *ospf;
int type;
- u_short instance; // PENDING
/* If OSPF instatnce does not exist, return right now. */
ospf = ospf_lookup ();
@@ -532,15 +531,18 @@ route_set_metric_compile (const char *arg)
set metric <+/-metric> check
Ignore the +/- component */
if (! all_digit (arg))
- if ((strncmp (arg, "+", 1) == 0 || strncmp (arg, "-", 1) == 0) &&
- all_digit (arg+1))
- {
- zlog_warn ("OSPF does not support 'set metric +/-'");
- arg++;
- }
- else
- return NULL;
-
+ {
+ if ((strncmp (arg, "+", 1) == 0 || strncmp (arg, "-", 1) == 0) &&
+ all_digit (arg+1))
+ {
+ zlog_warn ("OSPF does not support 'set metric +/-'");
+ arg++;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
metric = XCALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_int32_t));
ret = atoi (arg);
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 014831629..71ba8e9ea 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -592,6 +592,7 @@ ospf_nexthop_calculation (struct ospf_area *area, struct vertex *v,
if (l->m[0].type == LSA_LINK_TYPE_POINTOPOINT)
{
struct in_addr nexthop;
+ nexthop.s_addr = 0;
/* If the destination is a router which connects to
the calculating router via a Point-to-MultiPoint
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 1f04cc36b..4a31c9a9a 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -383,9 +383,6 @@ ospf_zebra_add (struct prefix_ipv4 *p, struct ospf_route *or)
struct stream *s;
struct ospf_path *path;
struct listnode *node;
-#ifdef HAVE_NETLINK
- int ol_cnt = 0, not_ol_cnt = 0;
-#endif /* HAVE_NETLINK */
struct ospf *ospf = ospf_lookup ();
if (redist_check_instance(&zclient->redist[AFI_IP][ZEBRA_ROUTE_OSPF], ospf->instance))
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index ff9a82c37..721d38950 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -498,7 +498,7 @@ ospf_finish_final (struct ospf *ospf)
struct ospf_vl_data *vl_data;
struct listnode *node, *nnode;
int i;
- u_short instance;
+ u_short instance = 0;
#ifdef HAVE_OPAQUE_LSA
ospf_opaque_type11_lsa_term (ospf);