child-cfg: Allow passing NULL as proposal to add_proposal()

Making the API consistent to the one of ike_cfg.
This commit is contained in:
Martin Willi
2014-05-16 16:01:21 +02:00
parent 3312c447ef
commit 356846db5d
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -149,7 +149,10 @@ METHOD(child_cfg_t, get_name, char*,
METHOD(child_cfg_t, add_proposal, void,
private_child_cfg_t *this, proposal_t *proposal)
{
this->proposals->insert_last(this->proposals, proposal);
if (proposal)
{
this->proposals->insert_last(this->proposals, proposal);
}
}
METHOD(child_cfg_t, get_proposals, linked_list_t*,
+3 -3
View File
@@ -73,10 +73,10 @@ struct child_cfg_t {
* Add a proposal to the list.
*
* The proposals are stored by priority, first added
* is the most preferred.
* After add, proposal is owned by child_cfg.
* is the most preferred. It is safe to add NULL as proposal, which has no
* effect. After add, proposal is owned by child_cfg.
*
* @param proposal proposal to add
* @param proposal proposal to add, or NULL
*/
void (*add_proposal) (child_cfg_t *this, proposal_t *proposal);