tap: Eliminate goto from tap_handler()
The goto here really doesn't improve clarity or brevity at all. Use a clearer construct. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
b62ed9ca0e
commit
42bfd212b1
1 changed files with 7 additions and 12 deletions
11
tap.c
11
tap.c
|
@ -1229,18 +1229,13 @@ void tap_handler(struct ctx *c, int fd, uint32_t events,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((c->mode == MODE_PASST && tap_handler_passt(c, now)) ||
|
if ((c->mode == MODE_PASST && tap_handler_passt(c, now)) ||
|
||||||
(c->mode == MODE_PASTA && tap_handler_pasta(c, now)))
|
(c->mode == MODE_PASTA && tap_handler_pasta(c, now)) ||
|
||||||
goto reinit;
|
(events & (EPOLLRDHUP | EPOLLHUP | EPOLLERR))) {
|
||||||
|
|
||||||
if (events & (EPOLLRDHUP | EPOLLHUP | EPOLLERR))
|
|
||||||
goto reinit;
|
|
||||||
|
|
||||||
return;
|
|
||||||
reinit:
|
|
||||||
if (c->one_off) {
|
if (c->one_off) {
|
||||||
info("Client closed connection, exiting");
|
info("Client closed connection, exiting");
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
tap_sock_init(c);
|
tap_sock_init(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue