summaryrefslogtreecommitdiff
path: root/ospfd/ospf_ext.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2018-08-21 21:22:45 +0200
committerGitHub <noreply@github.com>2018-08-21 21:22:45 +0200
commit9e32cce03ff1873c47c388881092ce11ce6d7b03 (patch)
treeb1715076edc2c0b8ceb58e915091f6713a520568 /ospfd/ospf_ext.c
parentf4c28c44868d8ef99a810b995d0dc6df03cc60b7 (diff)
parent5b3d4186defcf9faa15fce45703ee8c5a80f74db (diff)
Merge pull request #2876 from donaldsharp/lsa_new_and_data
ospfd: Add ospf_lsa_new_and_data function and abstract away
Diffstat (limited to 'ospfd/ospf_ext.c')
-rw-r--r--ospfd/ospf_ext.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/ospfd/ospf_ext.c b/ospfd/ospf_ext.c
index b8d14c351e..f6ed9b81b9 100644
--- a/ospfd/ospf_ext.c
+++ b/ospfd/ospf_ext.c
@@ -977,20 +977,7 @@ static struct ospf_lsa *ospf_ext_pref_lsa_new(struct ospf_area *area,
lsah->length = htons(length);
/* Now, create an OSPF LSA instance. */
- new = ospf_lsa_new();
- if (new == NULL) {
- zlog_warn("EXT (%s): ospf_lsa_new() error", __func__);
- stream_free(s);
- return NULL;
- }
- new->data = ospf_lsa_data_new(length);
- if (new->data == NULL) {
- zlog_warn("EXT (%s): ospf_lsa_data_new() error", __func__);
- ospf_lsa_unlock(&new);
- new = NULL;
- stream_free(s);
- return NULL;
- }
+ new = ospf_lsa_new_and_data(length);
/* Segment Routing belongs only to default VRF */
new->vrf_id = VRF_DEFAULT;
@@ -1056,20 +1043,7 @@ static struct ospf_lsa *ospf_ext_link_lsa_new(struct ospf_area *area,
lsah->length = htons(length);
/* Now, create an OSPF LSA instance. */
- new = ospf_lsa_new();
- if (new == NULL) {
- zlog_warn("EXT (%s): ospf_lsa_new() error", __func__);
- stream_free(s);
- return NULL;
- }
- new->data = ospf_lsa_data_new(length);
- if (new->data == NULL) {
- zlog_warn("EXT (%s): ospf_lsa_data_new() error", __func__);
- ospf_lsa_unlock(&new);
- new = NULL;
- stream_free(s);
- return NULL;
- }
+ new = ospf_lsa_new_and_data(length);
/* Segment Routing belongs only to default VRF */
new->vrf_id = VRF_DEFAULT;