summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_abr.c4
-rw-r--r--ospfd/ospf_api.c12
-rw-r--r--ospfd/ospf_apiserver.c3
-rw-r--r--ospfd/ospf_asbr.c3
-rw-r--r--ospfd/ospf_ase.c2
-rw-r--r--ospfd/ospf_dump.c2
-rw-r--r--ospfd/ospf_interface.c13
-rw-r--r--ospfd/ospf_lsa.c11
-rw-r--r--ospfd/ospf_neighbor.c3
-rw-r--r--ospfd/ospf_network.c1
-rw-r--r--ospfd/ospf_route.c2
-rw-r--r--ospfd/ospf_snmp.c8
-rw-r--r--ospfd/ospf_te.c6
-rw-r--r--ospfd/ospf_vty.c13
-rw-r--r--ospfd/ospf_zebra.c15
15 files changed, 40 insertions, 58 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 88636f1a..d60ad120 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -614,6 +614,7 @@ set_metric (struct ospf_lsa *lsa, u_int32_t metric)
memcpy(header->metric, mp, 3);
}
+#if 0
static int
ospf_abr_check_nssa_range (struct prefix_ipv4 *p, u_int32_t cost,
struct ospf_area *area)
@@ -622,6 +623,7 @@ ospf_abr_check_nssa_range (struct prefix_ipv4 *p, u_int32_t cost,
for lsa installation and flooding */
return 0;
}
+#endif
/* ospf_abr_translate_nssa */
static int
@@ -1580,6 +1582,7 @@ ospf_abr_send_nssa_aggregates (struct ospf *ospf) /* temporarily turned off */
zlog_debug ("ospf_abr_send_nssa_aggregates(): Stop");
}
+#if 0
static void
ospf_abr_announce_nssa_defaults (struct ospf *ospf) /* By ABR-Translator */
{
@@ -1615,6 +1618,7 @@ ospf_abr_announce_nssa_defaults (struct ospf *ospf) /* By ABR-Translator */
}
}
}
+#endif
static void
ospf_abr_announce_stub_defaults (struct ospf *ospf)
diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c
index 9c9997ba..fc3b51dd 100644
--- a/ospfd/ospf_api.c
+++ b/ospfd/ospf_api.c
@@ -99,8 +99,7 @@ msg_new (u_char msgtype, void *msgbody, u_int32_t seqnum, u_int16_t msglen)
{
struct msg *new;
- new = XMALLOC (MTYPE_OSPF_API_MSG, sizeof (struct msg));
- memset (new, 0, sizeof (struct msg));
+ new = XCALLOC (MTYPE_OSPF_API_MSG, sizeof (struct msg));
new->hdr.version = OSPF_API_VERSION;
new->hdr.msgtype = msgtype;
@@ -220,7 +219,7 @@ msg_print (struct msg *msg)
#else /* ORIGINAL_CODING */
/* API message common header part. */
zlog_debug
- ("API-msg [%s]: type(%d),len(%d),seq(%lu),data(%p),size(%lu)",
+ ("API-msg [%s]: type(%d),len(%d),seq(%lu),data(%p),size(%zd)",
ospf_api_typename (msg->hdr.msgtype), msg->hdr.msgtype,
ntohs (msg->hdr.msglen), (unsigned long) ntohl (msg->hdr.msgseq),
STREAM_DATA (msg->s), STREAM_SIZE (msg->s));
@@ -271,12 +270,7 @@ msg_get_seq (struct msg *msg)
struct msg_fifo *
msg_fifo_new ()
{
- struct msg_fifo *new;
-
- new = XMALLOC (MTYPE_OSPF_API_FIFO, sizeof (struct msg_fifo));
- memset (new, 0, sizeof (struct msg_fifo));
-
- return new;
+ return XCALLOC (MTYPE_OSPF_API_FIFO, sizeof (struct msg_fifo));
}
/* Add new message to fifo. */
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index dac4c93f..15fd2e5f 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -937,8 +937,7 @@ ospf_apiserver_register_opaque_type (struct ospf_apiserver *apiserv,
type. */
regtype =
- XMALLOC (MTYPE_OSPF_APISERVER, sizeof (struct registered_opaque_type));
- memset (regtype, 0, sizeof (struct registered_opaque_type));
+ XCALLOC (MTYPE_OSPF_APISERVER, sizeof (struct registered_opaque_type));
regtype->lsa_type = lsa_type;
regtype->opaque_type = opaque_type;
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index a4826237..6f1b0b06 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -104,8 +104,7 @@ ospf_external_info_new (u_char type)
struct external_info *new;
new = (struct external_info *)
- XMALLOC (MTYPE_OSPF_EXTERNAL_INFO, sizeof (struct external_info));
- memset (new, 0, sizeof (struct external_info));
+ XCALLOC (MTYPE_OSPF_EXTERNAL_INFO, sizeof (struct external_info));
new->type = type;
ospf_reset_route_map_set_values (&new->route_map_set);
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index a4812345..47f8851f 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -156,6 +156,7 @@ ospf_ase_forward_address_check (struct ospf *ospf, struct in_addr fwd_addr)
return 1;
}
+#if 0
/* Calculate ASBR route. */
static struct ospf_route *
ospf_ase_calculate_asbr_route (struct ospf *ospf,
@@ -236,6 +237,7 @@ ospf_ase_calculate_asbr_route (struct ospf *ospf,
return asbr_route;
}
+#endif
static struct ospf_route *
ospf_ase_calculate_new_route (struct ospf_lsa *lsa,
diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c
index 2fcbfe64..de9ef055 100644
--- a/ospfd/ospf_dump.c
+++ b/ospfd/ospf_dump.c
@@ -1509,7 +1509,7 @@ DEFUN (show_debugging_ospf,
}
/* Debug node. */
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"",
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 63681429..5d4f415f 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -638,8 +638,7 @@ ospf_if_new_hook (struct interface *ifp)
{
int rc = 0;
- ifp->info = XMALLOC (MTYPE_OSPF_IF_INFO, sizeof (struct ospf_if_info));
- memset (ifp->info, 0, sizeof (struct ospf_if_info));
+ ifp->info = XCALLOC (MTYPE_OSPF_IF_INFO, sizeof (struct ospf_if_info));
IF_OIFS (ifp) = route_table_init ();
IF_OIFS_PARAMS (ifp) = route_table_init ();
@@ -814,8 +813,7 @@ ospf_vl_data_new (struct ospf_area *area, struct in_addr vl_peer)
{
struct ospf_vl_data *vl_data;
- vl_data = XMALLOC (MTYPE_OSPF_VL_DATA, sizeof (struct ospf_vl_data));
- memset (vl_data, 0, sizeof (struct ospf_vl_data));
+ vl_data = XCALLOC (MTYPE_OSPF_VL_DATA, sizeof (struct ospf_vl_data));
vl_data->vl_peer.s_addr = vl_peer.s_addr;
vl_data->vl_area_id = area->area_id;
@@ -1180,12 +1178,7 @@ ospf_vls_in_area (struct ospf_area *area)
struct crypt_key *
ospf_crypt_key_new ()
{
- struct crypt_key *ck;
-
- ck = XMALLOC (MTYPE_OSPF_CRYPT_KEY, sizeof (struct crypt_key));
- memset (ck, 0, sizeof (struct crypt_key));
-
- return ck;
+ return XCALLOC (MTYPE_OSPF_CRYPT_KEY, sizeof (struct crypt_key));
}
void
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index f453353d..7dab0ca0 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -304,12 +304,7 @@ ospf_lsa_discard (struct ospf_lsa *lsa)
struct lsa_header *
ospf_lsa_data_new (size_t size)
{
- struct lsa_header *new;
-
- new = (struct lsa_header *) XMALLOC (MTYPE_OSPF_LSA_DATA, size);
- memset (new, 0, size);
-
- return new;
+ return XCALLOC (MTYPE_OSPF_LSA_DATA, size);
}
/* Duplicate LSA data. */
@@ -504,7 +499,7 @@ link_info_set (struct stream *s, struct in_addr id,
if (ret == OSPF_MAX_LSA_SIZE)
{
- zlog_warn ("%s: Out of space in LSA stream, left %ld, size %ld",
+ zlog_warn ("%s: Out of space in LSA stream, left %zd, size %zd",
__func__, STREAM_REMAIN (s), STREAM_SIZE (s));
return 0;
}
@@ -1873,6 +1868,7 @@ ospf_lsa_translated_nssa_new (struct ospf *ospf,
return new;
}
+#if 0
/* compare type-5 to type-7
* -1: err, 0: same, 1: different
*/
@@ -1909,6 +1905,7 @@ ospf_lsa_translated_nssa_compare (struct ospf_lsa *t7, struct ospf_lsa *t5)
return LSA_REFRESH_IF_CHANGED;
}
+#endif
/* Originate Translated Type-5 for supplied Type-7 NSSA LSA */
struct ospf_lsa *
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index 843e93f6..967ca15d 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -69,8 +69,7 @@ ospf_nbr_new (struct ospf_interface *oi)
struct ospf_neighbor *nbr;
/* Allcate new neighbor. */
- nbr = XMALLOC (MTYPE_OSPF_NEIGHBOR, sizeof (struct ospf_neighbor));
- memset (nbr, 0, sizeof (struct ospf_neighbor));
+ nbr = XCALLOC (MTYPE_OSPF_NEIGHBOR, sizeof (struct ospf_neighbor));
/* Relate neighbor to the interface. */
nbr->oi = oi;
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 89ff2038..8e9030ca 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -209,6 +209,7 @@ ospf_sock_init (void)
close (ospf_sock); /* Prevent sd leak. */
return ret;
}
+ }
#else /* !IPTOS_PREC_INTERNETCONTROL */
#warning "IP_HDRINCL not available, nor is IPTOS_PREC_INTERNETCONTROL"
zlog_warn ("IP_HDRINCL option not available");
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 50fba750..edcf4eeb 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -270,6 +270,7 @@ ospf_route_install (struct ospf *ospf, struct route_table *rt)
}
}
+#if 0
static void
ospf_intra_route_add (struct route_table *rt, struct vertex *v,
struct ospf_area *area)
@@ -324,6 +325,7 @@ ospf_intra_route_add (struct route_table *rt, struct vertex *v,
rn->info = or;
}
+#endif
/* RFC2328 16.1. (4). For "router". */
void
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index e6ce1f01..adac7680 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1391,11 +1391,7 @@ struct ospf_snmp_if
struct ospf_snmp_if *
ospf_snmp_if_new ()
{
- struct ospf_snmp_if *osif;
-
- osif = XMALLOC (0, sizeof (struct ospf_snmp_if));
- memset (osif, 0, sizeof (struct ospf_snmp_if));
- return osif;
+ return XCALLOC (0, sizeof (struct ospf_snmp_if));
}
void
@@ -1563,6 +1559,7 @@ ospf_snmp_if_lookup_next (struct in_addr *ifaddr, unsigned int *ifindex,
{
/* Usual interface */
if (ifaddr->s_addr)
+ {
/* The interface must have valid AF_INET connected address */
/* it must have lager IPv4 address value than the lookup entry */
if ((ospf_snmp_is_if_have_addr(osif->ifp)) &&
@@ -1576,6 +1573,7 @@ ospf_snmp_if_lookup_next (struct in_addr *ifaddr, unsigned int *ifindex,
if (oi)
return oi;
}
+ }
/* Unnumbered interface */
else
/* The interface must NOT have valid AF_INET connected address */
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index a3ebe62e..c5ec0ad8 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -561,13 +561,13 @@ ospf_mpls_te_new_if (struct interface *ifp)
goto out;
}
- if ((new = XMALLOC (MTYPE_OSPF_MPLS_TE_LINKPARAMS,
- sizeof (struct mpls_te_link))) == NULL)
+ new = XCALLOC (MTYPE_OSPF_MPLS_TE_LINKPARAMS,
+ sizeof (struct mpls_te_link));
+ if (new == NULL)
{
zlog_warn ("ospf_mpls_te_new_if: XMALLOC: %s", safe_strerror (errno));
goto out;
}
- memset (new, 0, sizeof (struct mpls_te_link));
new->area = NULL;
new->flags = 0;
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 11f12c5c..22182e69 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3766,6 +3766,7 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa)
return 0;
}
+#if 0
/* N.B. This function currently seems to be unused. */
static int
show_as_external_lsa_stdvty (struct ospf_lsa *lsa)
@@ -3790,6 +3791,7 @@ show_as_external_lsa_stdvty (struct ospf_lsa *lsa)
return 0;
}
+#endif
/* Show AS-NSSA-LSA detail information. */
static int
@@ -8054,7 +8056,7 @@ ospf_vty_show_init (void)
/* ospfd's interface node. */
-struct cmd_node interface_node =
+static struct cmd_node interface_node =
{
INTERFACE_NODE,
"%s(config-if)# ",
@@ -8163,13 +8165,6 @@ ospf_vty_if_init (void)
install_element (INTERFACE_NODE, &no_ospf_transmit_delay_cmd);
}
-/* Zebra node structure. */
-struct cmd_node zebra_node =
-{
- ZEBRA_NODE,
- "%s(config-router)#",
-};
-
static void
ospf_vty_zebra_init (void)
{
@@ -8262,7 +8257,7 @@ ospf_vty_zebra_init (void)
#endif /* 0 */
}
-struct cmd_node ospf_node =
+static struct cmd_node ospf_node =
{
OSPF_NODE,
"%s(config-router)# ",
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index e27f1394..8f61d67d 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -91,8 +91,9 @@ ospf_interface_add (int command, struct zclient *zclient, zebra_size_t length)
ifp = zebra_interface_add_read (zclient->ibuf);
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
- zlog_debug ("Zebra: interface add %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ zlog_debug ("Zebra: interface add %s index %d flags %#llx metric %d mtu %d",
+ ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
+ ifp->metric, ifp->mtu);
assert (ifp->info);
@@ -132,8 +133,9 @@ ospf_interface_delete (int command, struct zclient *zclient,
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
zlog_debug
- ("Zebra: interface delete %s index %d flags %ld 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);
@@ -1113,10 +1115,7 @@ ospf_prefix_list_update (struct prefix_list *plist)
static struct ospf_distance *
ospf_distance_new (void)
{
- struct ospf_distance *new;
- new = XMALLOC (MTYPE_OSPF_DISTANCE, sizeof (struct ospf_distance));
- memset (new, 0, sizeof (struct ospf_distance));
- return new;
+ return XCALLOC (MTYPE_OSPF_DISTANCE, sizeof (struct ospf_distance));
}
static void