return -1;
}
- if (pl_new(nlabel, bs) == NULL)
- return -1;
+ pl_new(nlabel, bs);
return 0;
}
/* Get BFD session storage with its defaults. */
bfd = bfd_session_new();
- if (bfd == NULL) {
- zlog_err("session-new: allocation failed");
- return NULL;
- }
/*
* Store interface/VRF name in case we need to delay session
}
bs = bfd_session_new();
- if (bs == NULL)
- return NB_ERR_RESOURCE;
/* Fill the session key. */
bfd_session_get_key(mhop, dnode, &bs->key);
return 0;
}
- if (control_new(csock) == NULL)
- close(csock);
+ control_new(csock);
bglobal.bg_csockev = NULL;
thread_add_read(master, control_accept, NULL, sd, &bglobal.bg_csockev);
struct bfd_control_buffer *bcb;
bcq = control_queue_new(bcs);
- if (bcq == NULL)
- return -1;
bcb = &bcq->bcq_bcb;
bcb->bcb_left = sizeof(struct bfd_control_msg) + ntohl(bcm->bcm_length);
if (bs == NULL)
return -1;
- if (control_notifypeer_new(bcs, bs) == NULL)
- return -1;
+ control_notifypeer_new(bcs, bs);
/* Notify peer status. */
_control_notify(bcs, bs);
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);
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;
}
/* 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);
}
*/
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;