diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-13 19:23:03 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-04-14 14:35:08 +0200 |
commit | 08de92aff34ac1734633a99aed543657e1069192 (patch) | |
tree | a8fd4340d173dc1bd4c71512a519c291806c7110 /bfdd/ptm_adapter.c | |
parent | bfdd: add debug fine tuning capabilities (diff) | |
download | frr-08de92aff34ac1734633a99aed543657e1069192.tar.xz frr-08de92aff34ac1734633a99aed543657e1069192.zip |
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 0f1c4d06c..d3fb26c34 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; |