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/control.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/control.c')
-rw-r--r-- | bfdd/control.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/bfdd/control.c b/bfdd/control.c index 4adc54a64..3b954c64f 100644 --- a/bfdd/control.c +++ b/bfdd/control.c @@ -168,8 +168,7 @@ int control_accept(struct thread *t) 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); @@ -334,8 +333,6 @@ static int control_queue_enqueue(struct bfd_control_socket *bcs, 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); @@ -656,8 +653,7 @@ static int notify_add_cb(struct bfd_peer_cfg *bpc, void *arg) 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); |