ospfd: ospfd-warnings.patch

Remove compile warnings for the ospfd/ospf6d directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
This commit is contained in:
Donald Sharp 2015-05-19 18:29:14 -07:00
parent e5f745ca93
commit ed2eb093c7
20 changed files with 36 additions and 72 deletions

View File

@ -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))

View File

@ -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));

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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"

View File

@ -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

View File

@ -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);
}

View File

@ -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,

View File

@ -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];

View File

@ -184,20 +184,6 @@ ospf6_delete (struct ospf6 *o)
XFREE (MTYPE_OSPF6_TOP, 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)
{
@ -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)
{

View File

@ -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);

View File

@ -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));
}

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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

View File

@ -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))

View File

@ -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);