From f5a31ee94c37f92729d458335705f5befa168151 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Sat, 24 Sep 2022 19:08:19 +1000 Subject: Don't use indirect remap functions for conf_ports() Now that we've delayed initialization of the UDP specific "reverse" map until udp_init(), the only difference between the various 'remap' functions used in conf_ports() is which array they target. So, simplify by open coding the logic into conf_ports() with a pointer to the correct mapping array. Signed-off-by: David Gibson --- tcp.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index e44177f..509a0b3 100644 --- a/tcp.c +++ b/tcp.c @@ -948,28 +948,6 @@ static void conn_event_do(const struct ctx *c, struct tcp_conn *conn, conn_event_do(c, conn, event); \ } while (0) -/** - * tcp_remap_to_tap() - Set delta for port translation toward guest/tap - * @c: Execution context - * @port: Original destination port, host order - * @delta: Delta to be added to original destination port - */ -void tcp_remap_to_tap(struct ctx *c, in_port_t port, in_port_t delta) -{ - c->tcp.fwd_in.delta[port] = delta; -} - -/** - * tcp_remap_to_tap() - Set delta for port translation toward init namespace - * @c: Execution context - * @port: Original destination port, host order - * @delta: Delta to be added to original destination port - */ -void tcp_remap_to_init(struct ctx *c, in_port_t port, in_port_t delta) -{ - c->tcp.fwd_out.delta[port] = delta; -} - /** * tcp_rtt_dst_low() - Check if low RTT was seen for connection endpoint * @conn: Connection pointer -- cgit v1.2.3