Future changes will want these functions to call things that are currently below them in the file, so move them later. Code motion only, no change to logic for now. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- tcp.c | 58 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tcp.c b/tcp.c index 4b478432..78f546db 100644 --- a/tcp.c +++ b/tcp.c @@ -853,35 +853,6 @@ static int tcp_opt_get(const char *opts, size_t len, uint8_t type_find, return -1; } -/** - * tcp_flow_defer() - Deferred per-flow handling (clean up closed connections) - * @conn: Connection to handle - * - * Return: true if the connection is ready to free, false otherwise - */ -bool tcp_flow_defer(const struct tcp_tap_conn *conn) -{ - if (conn->events != CLOSED) - return false; - - close(conn->sock); - if (conn->timer != -1) - close(conn->timer); - - return true; -} - -/** - * tcp_defer_handler() - Handler for TCP deferred tasks - * @c: Execution context - */ -/* cppcheck-suppress [constParameterPointer, unmatchedSuppression] */ -void tcp_defer_handler(struct ctx *c) -{ - tcp_flags_flush(c); - tcp_payload_flush(c); -} - /** * tcp_fill_header() - Fill the TCP header fields for a given TCP segment. * @@ -2272,6 +2243,35 @@ void tcp_sock_handler(const struct ctx *c, union epoll_ref ref, } } +/** + * tcp_flow_defer() - Deferred per-flow handling (clean up closed connections) + * @conn: Connection to handle + * + * Return: true if the connection is ready to free, false otherwise + */ +bool tcp_flow_defer(const struct tcp_tap_conn *conn) +{ + if (conn->events != CLOSED) + return false; + + close(conn->sock); + if (conn->timer != -1) + close(conn->timer); + + return true; +} + +/** + * tcp_defer_handler() - Handler for TCP deferred tasks + * @c: Execution context + */ +/* cppcheck-suppress [constParameterPointer, unmatchedSuppression] */ +void tcp_defer_handler(struct ctx *c) +{ + tcp_flags_flush(c); + tcp_payload_flush(c); +} + /** * tcp_sock_init_af() - Initialise listening socket for a given af and port * @c: Execution context -- 2.46.0