diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-20 20:41:37 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-20 20:41:37 -0400 | 
| commit | 5b3d4186defcf9faa15fce45703ee8c5a80f74db (patch) | |
| tree | 9d5bbdd64223747a6cb6b28ecc9259a605643528 /ospfd/ospf_packet.c | |
| parent | 164ab8625e05ddc4f21d7da9fe1f20f50899e13e (diff) | |
ospfd: Add ospf_lsa_new_and_data function and abstract away
In all but one instance we were following this pattern
with ospf_lsa_new:
ospf_lsa_new()
ospf_lsa_data_new()
so let's create a ospf_lsa_new_and_data to abstract
this bit of fun and cleanup all the places where
it assumes these function calls can fail.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_packet.c')
| -rw-r--r-- | ospfd/ospf_packet.c | 3 | 
1 files changed, 1 insertions, 2 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index f1d4a39dba..56b83d22d5 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -1742,7 +1742,7 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,  		}  		/* Create OSPF LSA instance. */ -		lsa = ospf_lsa_new(); +		lsa = ospf_lsa_new_and_data(length);  		lsa->vrf_id = oi->ospf->vrf_id;  		/* We may wish to put some error checking if type NSSA comes in @@ -1761,7 +1761,6 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,  			break;  		} -		lsa->data = ospf_lsa_data_new(length);  		memcpy(lsa->data, lsah, length);  		if (IS_DEBUG_OSPF_EVENT)  | 
