diff options
Diffstat (limited to 'ospfd/ospf_lsa.c')
-rw-r--r-- | ospfd/ospf_lsa.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index f453353d..aaf1f484 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 * @@ -3635,9 +3632,7 @@ ospf_schedule_lsa_flood_area (struct ospf_area *area, struct ospf_lsa *lsa) { struct lsa_action *data; - data = XMALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); - memset (data, 0, sizeof (struct lsa_action)); - + data = XCALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); data->action = LSA_ACTION_FLOOD_AREA; data->area = area; data->lsa = ospf_lsa_lock (lsa); /* Message / Flood area */ @@ -3650,9 +3645,7 @@ ospf_schedule_lsa_flush_area (struct ospf_area *area, struct ospf_lsa *lsa) { struct lsa_action *data; - data = XMALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); - memset (data, 0, sizeof (struct lsa_action)); - + data = XCALLOC (MTYPE_OSPF_MESSAGE, sizeof (struct lsa_action)); data->action = LSA_ACTION_FLUSH_AREA; data->area = area; data->lsa = ospf_lsa_lock (lsa); /* Message / Flush area */ |