ospf_apiserver_event (enum event event, int fd,
struct ospf_apiserver *apiserv)
{
- struct thread *apiserver_serv_thread;
-
switch (event)
{
case OSPF_APISERVER_ACCEPT:
- apiserver_serv_thread =
- thread_add_read (master, ospf_apiserver_accept, apiserv, fd);
+ (void)thread_add_read (master, ospf_apiserver_accept, apiserv, fd);
break;
case OSPF_APISERVER_SYNC_READ:
apiserv->t_sync_read =
struct in_addr old_dr, old_bdr;
int old_state, new_state;
struct list *el_list;
- struct ospf_neighbor *dr, *bdr;
/* backup current values. */
old_dr = DR (oi);
ospf_dr_eligible_routers (oi->nbrs, el_list);
/* First election of DR and BDR. */
- bdr = ospf_elect_bdr (oi, el_list);
- dr = ospf_elect_dr (oi, el_list);
+ ospf_elect_bdr (oi, el_list);
+ ospf_elect_dr (oi, el_list);
new_state = ospf_ism_state (oi);
if (IS_LSA_SELF (lsa))
lsa->oi = oi; /* Specify outgoing ospf-interface for this LSA. */
else
- ; /* Incoming "oi" for this LSA has set at LSUpd reception. */
+ {
+ /* Incoming "oi" for this LSA has set at LSUpd reception. */
+ }
/* Fallthrough */
case OSPF_OPAQUE_AREA_LSA:
case OSPF_OPAQUE_AS_LSA:
extern int get_age (struct ospf_lsa *);
extern u_int16_t ospf_lsa_checksum (struct lsa_header *);
+extern int ospf_lsa_checksum_valid (struct lsa_header *);
extern int ospf_lsa_refresh_delay (struct ospf_lsa *);
extern const char *dump_lsa_key (struct ospf_lsa *);
}
void
-ospf_adjust_sndbuflen (struct ospf * ospf, int buflen)
+ospf_adjust_sndbuflen (struct ospf * ospf, unsigned int buflen)
{
int ret, newbuflen;
/* Check if any work has to be done at all. */
*/
ret = setsockopt_so_sendbuf (ospf->fd, buflen);
newbuflen = getsockopt_so_sendbuf (ospf->fd);
- if (ret < 0 || newbuflen < buflen)
- zlog_warn ("%s: tried to set SO_SNDBUF to %d, but got %d",
+ if (ret < 0 || newbuflen < 0 || newbuflen < (int) buflen)
+ zlog_warn ("%s: tried to set SO_SNDBUF to %u, but got %d",
__func__, buflen, newbuflen);
if (newbuflen >= 0)
- ospf->maxsndbuflen = newbuflen;
+ ospf->maxsndbuflen = (unsigned int)newbuflen;
else
zlog_warn ("%s: failed to get SO_SNDBUF", __func__);
if (ospfd_privs.change (ZPRIVS_LOWER))
unsigned int);
extern int ospf_if_ipmulticast (struct ospf *, struct prefix *, unsigned int);
extern int ospf_sock_init (void);
-extern void ospf_adjust_sndbuflen (struct ospf *, int);
+extern void ospf_adjust_sndbuflen (struct ospf *, unsigned int);
#endif /* _ZEBRA_OSPF_NETWORK_H */
static int
ospf_db_desc_timer (struct thread *thread)
{
- struct ospf_interface *oi;
struct ospf_neighbor *nbr;
nbr = THREAD_ARG (thread);
nbr->t_db_desc = NULL;
- oi = nbr->oi;
-
if (IS_DEBUG_OSPF (nsm, NSM_TIMERS))
zlog (NULL, LOG_DEBUG, "NSM[%s:%s]: Timer (DD Retransmit timer expire)",
IF_NAME (nbr->oi), inet_ntoa (nbr->src));
int event;
int next_state;
struct ospf_neighbor *nbr;
- struct in_addr router_id;
nbr = THREAD_ARG (thread);
event = THREAD_VAL (thread);
- router_id = nbr->router_id;
if (IS_DEBUG_OSPF (nsm, NSM_EVENTS))
zlog_debug ("NSM[%s:%s]: %s (%s)", IF_NAME (nbr->oi),
default:
if (OPAQUE_TYPE_RANGE_UNASSIGNED (opaque_type))
name = "Unassigned";
- /* XXX warning: comparison is always true due to limited range of data type */
- else if (OPAQUE_TYPE_RANGE_RESERVED (opaque_type))
- name = "Private/Experimental";
+ else
+ {
+ u_int32_t bigger_range = opaque_type;
+ /*
+ * Get around type-limits warning: comparison is always true due to limited range of data type
+ */
+ if (OPAQUE_TYPE_RANGE_RESERVED (bigger_range))
+ name = "Private/Experimental";
+ }
break;
}
return name;
/* Process each LSA received in the one packet.
*
* Numbers in parentheses, e.g. (1), (2), etc., and the corresponding
- * text below are from the stepsin RFC 2328, Section 13.
+ * text below are from the steps in RFC 2328, Section 13.
*/
for (ALL_LIST_ELEMENTS (lsas, node, nnode, lsa))
{
struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
- u_int32_t cost;
int format;
struct prefix_ipv4 p;
VTY_GET_OSPF_AREA_ID_NO_BB ("default-cost", area_id, format, argv[0]);
- VTY_GET_INTEGER_RANGE ("stub default cost", cost, argv[1], 0, 16777215);
+ VTY_CHECK_INTEGER_RANGE ("stub default cost", argv[1], 0, OSPF_LS_INFINITY);
area = ospf_area_lookup_by_area_id (ospf, area_id);
if (area == NULL)
struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
- struct prefix_list *plist;
int format;
VTY_GET_OSPF_AREA_ID (area_id, format, argv[0]);
if ((area = ospf_area_lookup_by_area_id (ospf, area_id)) == NULL)
return CMD_SUCCESS;
- plist = prefix_list_lookup (AFI_IP, argv[1]);
if (strncmp (argv[2], "in", 2) == 0)
{
if (PREFIX_NAME_IN (area))
{
struct ospf *ospf = vty->index;
struct in_addr nbr_addr;
- int ret;
VTY_GET_IPV4_ADDRESS ("neighbor address", nbr_addr, argv[0]);
- ret = ospf_nbr_nbma_unset (ospf, nbr_addr);
+ (void)ospf_nbr_nbma_unset (ospf, nbr_addr);
return CMD_SUCCESS;
}
"Address of interface")
{
struct interface *ifp = vty->index;
- u_int32_t priority;
+ long priority;
struct route_node *rn;
struct in_addr addr;
int ret;
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
zlog_debug
- ("Zebra: interface delete %s index %d flags %lld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ ("Zebra: interface delete %s index %d flags %llx metric %d mtu %d",
+ ifp->name, ifp->ifindex, (unsigned long long)ifp->flags, ifp->metric, ifp->mtu);
#ifdef HAVE_SNMP
ospf_snmp_if_delete (ifp);
/* Update distribute-list and set timer to apply access-list. */
void
-ospf_distribute_list_update (struct ospf *ospf, int type)
+ospf_distribute_list_update (struct ospf *ospf, uintptr_t type)
{
struct route_table *rt;
{
int ret;
struct prefix_ipv4 p;
- u_char distance;
struct route_node *rn;
struct ospf_distance *odistance;
return CMD_WARNING;
}
- distance = atoi (distance_str);
-
rn = route_node_lookup (ospf->distance_table, (struct prefix *) &p);
if (!rn)
{
int *);
extern int ospf_distribute_check_connected (struct ospf *,
struct external_info *);
-extern void ospf_distribute_list_update (struct ospf *, int);
+extern void ospf_distribute_list_update (struct ospf *, uintptr_t);
extern int ospf_is_type_redistributed (int);
extern void ospf_distance_reset (struct ospf *);
}
new->maxsndbuflen = getsockopt_so_sendbuf (new->fd);
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
- zlog_debug ("%s: starting with OSPF send buffer size %d",
+ zlog_debug ("%s: starting with OSPF send buffer size %u",
__func__, new->maxsndbuflen);
if ((new->ibuf = stream_new(OSPF_MAX_PACKET_SIZE+1)) == NULL)
{
struct thread *t_write;
struct thread *t_read;
int fd;
- int maxsndbuflen;
+ unsigned int maxsndbuflen;
struct stream *ibuf;
struct list *oi_write_q;