diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-08-18 19:08:37 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-08-18 19:22:07 +0200 |
commit | 743e4948eb3bdbdb3a7751c54f2c715ba829afd2 (patch) | |
tree | a7f352f620ea4c2c4180c99595767526d9495159 | |
parent | 097bb594e6844fe3edc1b01768a8ced37433378b (diff) | |
download | conntrack-tools-743e4948eb3bdbdb3a7751c54f2c715ba829afd2.tar.gz conntrack-tools-743e4948eb3bdbdb3a7751c54f2c715ba829afd2.zip |
conntrackd: simplify branch in tcp_accept()
The same code is executed regardless the reason why accept() has failed.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/tcp.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -247,13 +247,11 @@ int tcp_accept(struct tcp_sock *m) /* the other peer wants to connect ... */ ret = accept(m->fd, NULL, NULL); if (ret == -1) { - if (errno != EAGAIN) { - /* unexpected error. Give us another try. */ - m->state = TCP_SERVER_ACCEPTING; - } else { - /* waiting for new connections. */ - m->state = TCP_SERVER_ACCEPTING; - } + /* unexpected error: Give us another try. Or we have hit + * -EAGAIN, in that case we remain in the accepting connections + * state. + */ + m->state = TCP_SERVER_ACCEPTING; } else { /* the peer finally got connected. */ if (fcntl(ret, F_SETFL, O_NONBLOCK) == -1) { |