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 --- udp.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'udp.c') diff --git a/udp.c b/udp.c index eb32dda..d17b3b4 100644 --- a/udp.c +++ b/udp.c @@ -258,28 +258,6 @@ static struct mmsghdr udp_mmh_send [UDP_SPLICE_FRAMES]; static struct iovec udp_iov_sendto [UDP_SPLICE_FRAMES]; static struct mmsghdr udp_mmh_sendto [UDP_SPLICE_FRAMES]; -/** - * udp_remap_to_tap() - Set delta for port translation to/from guest/tap - * @c: Execution context - * @port: Original destination port, host order - * @delta: Delta to be added to original destination port - */ -void udp_remap_to_tap(struct ctx *c, in_port_t port, in_port_t delta) -{ - c->udp.fwd_in.f.delta[port] = delta; -} - -/** - * udp_remap_to_init() - Set delta for port translation to/from init namespace - * @c: Execution context - * @port: Original destination port, host order - * @delta: Delta to be added to original destination port - */ -void udp_remap_to_init(struct ctx *c, in_port_t port, in_port_t delta) -{ - c->udp.fwd_out.f.delta[port] = delta; -} - /** * udp_invert_portmap() - Compute reverse port translations for return packets * @fwd: Port forwarding configuration to compute reverse map for -- cgit v1.2.3