diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-13 14:23:03 -0300 | 
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-14 09:35:08 -0300 | 
| commit | 08de92aff34ac1734633a99aed543657e1069192 (patch) | |
| tree | a8fd4340d173dc1bd4c71512a519c291806c7110 /bfdd/ptm_adapter.c | |
| parent | 48da2c316908f8f841875f1e797de7cb8fb3b714 (diff) | |
bfdd: simplify code flow
Don't attempt to handle out-of-memory situations: XMALLOC/XCALLOC will
`assert` if there is no memory left.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/ptm_adapter.c')
| -rw-r--r-- | bfdd/ptm_adapter.c | 18 | 
1 files changed, 2 insertions, 16 deletions
diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 0f1c4d06c0..d3fb26c348 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -315,10 +315,6 @@ static int _ptm_msg_read(struct stream *msg, int command, vrf_id_t vrf_id,  	STREAM_GETL(msg, pid);  	*pc = pc_new(pid); -	if (*pc == NULL) { -		zlog_debug("ptm-read: failed to allocate memory"); -		return -1; -	}  	/* Register/update peer information. */  	_ptm_msg_read_address(msg, &bpc->bpc_peer); @@ -404,7 +400,6 @@ stream_failure:  static void bfdd_dest_register(struct stream *msg, vrf_id_t vrf_id)  {  	struct ptm_client *pc; -	struct ptm_client_notification *pcn;  	struct bfd_session *bs;  	struct bfd_peer_cfg bpc; @@ -432,11 +427,7 @@ static void bfdd_dest_register(struct stream *msg, vrf_id_t vrf_id)  	}  	/* Create client peer notification register. */ -	pcn = pcn_new(pc, bs); -	if (pcn == NULL) { -		zlog_err("ptm-add-dest: failed to registrate notifications"); -		return; -	} +	pcn_new(pc, bs);  	ptm_bfd_notify(bs, bs->ses_state);  } @@ -481,17 +472,12 @@ static void bfdd_dest_deregister(struct stream *msg, vrf_id_t vrf_id)   */  static void bfdd_client_register(struct stream *msg)  { -	struct ptm_client *pc;  	uint32_t pid;  	/* Find or allocate process context data. */  	STREAM_GETL(msg, pid); -	pc = pc_new(pid); -	if (pc == NULL) { -		zlog_err("ptm-add-client: failed to register client: %u", pid); -		return; -	} +	pc_new(pid);  	return;  | 
