diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2023-11-30 13:02:15 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-12-04 09:51:17 +0100 |
commit | 31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6 (patch) | |
tree | 512bc08cd77f5756cc2a21e823b88fcb8217b32d | |
parent | df96a4cb5d4f3907f1019ba50511ee9787443acf (diff) | |
download | passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.tar passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.tar.gz passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.tar.bz2 passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.tar.lz passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.tar.xz passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.tar.zst passt-31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6.zip |
tcp: Remove unneccessary bounds check in tcp_timer_handler()
In tcp_timer_handler() we use conn_at_idx() to interpret the flow index
from the epoll reference. However, this will never be NULL - we always
put a valid index into the epoll_ref. Simplify slightly based on this.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2758,10 +2758,10 @@ void tcp_listen_handler(struct ctx *c, union epoll_ref ref, */ void tcp_timer_handler(struct ctx *c, union epoll_ref ref) { - struct tcp_tap_conn *conn = conn_at_idx(ref.tcp.index); struct itimerspec check_armed = { { 0 }, { 0 } }; + struct tcp_tap_conn *conn = CONN(ref.tcp.index); - if (c->no_tcp || !conn) + if (c->no_tcp) return; /* We don't reset timers on ~ACK_FROM_TAP_DUE, ~ACK_TO_TAP_DUE. If the |