From 3b9098aa49bd083a7900dc6e0219bf76e389afd4 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 28 Feb 2024 22:25:20 +1100 Subject: fwd: Rename port_fwd.[ch] and their contents Currently port_fwd.[ch] contains helpers related to port forwarding, particular automatic port forwarding. We're planning to allow much more flexible sorts of forwarding, including both port translation and NAT based on the flow table. This will subsume the existing port forwarding logic, so rename port_fwd.[ch] to fwd.[ch] with matching updates to all the names within. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- Makefile | 12 ++--- conf.c | 8 ++-- fwd.c | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ fwd.h | 44 ++++++++++++++++++ passt.h | 2 +- port_fwd.c | 155 ------------------------------------------------------------- port_fwd.h | 44 ------------------ tcp.c | 4 +- tcp.h | 4 +- udp.c | 10 ++-- udp.h | 10 ++-- 11 files changed, 224 insertions(+), 224 deletions(-) create mode 100644 fwd.c create mode 100644 fwd.h delete mode 100644 port_fwd.c delete mode 100644 port_fwd.h diff --git a/Makefile b/Makefile index 24cc255..8f96694 100644 --- a/Makefile +++ b/Makefile @@ -44,19 +44,19 @@ FLAGS += -DARCH=\"$(TARGET_ARCH)\" FLAGS += -DVERSION=\"$(VERSION)\" FLAGS += -DDUAL_STACK_SOCKETS=$(DUAL_STACK_SOCKETS) -PASST_SRCS = arch.c arp.c checksum.c conf.c dhcp.c dhcpv6.c flow.c icmp.c \ - igmp.c inany.c iov.c isolation.c lineread.c log.c mld.c ndp.c \ - netlink.c packet.c passt.c pasta.c pcap.c pif.c port_fwd.c tap.c tcp.c \ +PASST_SRCS = arch.c arp.c checksum.c conf.c dhcp.c dhcpv6.c flow.c fwd.c \ + icmp.c igmp.c inany.c iov.c isolation.c lineread.c log.c mld.c ndp.c \ + netlink.c packet.c passt.c pasta.c pcap.c pif.c tap.c tcp.c \ tcp_splice.c udp.c util.c QRAP_SRCS = qrap.c SRCS = $(PASST_SRCS) $(QRAP_SRCS) MANPAGES = passt.1 pasta.1 qrap.1 -PASST_HEADERS = arch.h arp.h checksum.h conf.h dhcp.h dhcpv6.h flow.h \ +PASST_HEADERS = arch.h arp.h checksum.h conf.h dhcp.h dhcpv6.h flow.h fwd.h \ flow_table.h icmp.h inany.h iov.h isolation.h lineread.h log.h ndp.h \ - netlink.h packet.h passt.h pasta.h pcap.h pif.h port_fwd.h siphash.h \ - tap.h tcp.h tcp_conn.h tcp_splice.h udp.h util.h + netlink.h packet.h passt.h pasta.h pcap.h pif.h siphash.h tap.h tcp.h \ + tcp_conn.h tcp_splice.h udp.h util.h HEADERS = $(PASST_HEADERS) seccomp.h C := \#include \nstruct tcp_info x = { .tcpi_snd_wnd = 0 }; diff --git a/conf.c b/conf.c index fb77272..e630140 100644 --- a/conf.c +++ b/conf.c @@ -109,10 +109,10 @@ static int parse_port_range(const char *s, char **endptr, * @c: Execution context * @optname: Short option name, t, T, u, or U * @optarg: Option argument (port specification) - * @fwd: Pointer to @port_fwd to be updated + * @fwd: Pointer to @fwd_ports to be updated */ static void conf_ports(const struct ctx *c, char optname, const char *optarg, - struct port_fwd *fwd) + struct fwd_ports *fwd) { char addr_buf[sizeof(struct in6_addr)] = { 0 }, *addr = addr_buf; char buf[BUFSIZ], *spec, *ifname = NULL, *p; @@ -1158,7 +1158,7 @@ void conf(struct ctx *c, int argc, char **argv) }; char userns[PATH_MAX] = { 0 }, netns[PATH_MAX] = { 0 }; bool copy_addrs_opt = false, copy_routes_opt = false; - enum port_fwd_mode fwd_default = FWD_NONE; + enum fwd_ports_mode fwd_default = FWD_NONE; bool v4_only = false, v6_only = false; struct in6_addr *dns6 = c->ip6.dns; struct fqdn *dnss = c->dns_search; @@ -1746,7 +1746,7 @@ void conf(struct ctx *c, int argc, char **argv) if (!c->udp.fwd_out.f.mode) c->udp.fwd_out.f.mode = fwd_default; - port_fwd_init(c); + fwd_scan_ports_init(c); if (!c->quiet) conf_print(c); diff --git a/fwd.c b/fwd.c new file mode 100644 index 0000000..09650b2 --- /dev/null +++ b/fwd.c @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/* PASST - Plug A Simple Socket Transport + * for qemu/UNIX domain socket mode + * + * PASTA - Pack A Subtle Tap Abstraction + * for network namespace/tap device mode + * + * fwd.c - Port forwarding helpers + * + * Copyright Red Hat + * Author: Stefano Brivio + * Author: David Gibson + */ + +#include +#include +#include +#include +#include +#include + +#include "util.h" +#include "fwd.h" +#include "passt.h" +#include "lineread.h" + +/* See enum in kernel's include/net/tcp_states.h */ +#define UDP_LISTEN 0x07 +#define TCP_LISTEN 0x0a + +/** + * procfs_scan_listen() - Set bits for listening TCP or UDP sockets from procfs + * @fd: fd for relevant /proc/net file + * @lstate: Code for listening state to scan for + * @map: Bitmap where numbers of ports in listening state will be set + * @exclude: Bitmap of ports to exclude from setting (and clear) + * + * #syscalls:pasta lseek + * #syscalls:pasta ppc64le:_llseek ppc64:_llseek armv6l:_llseek armv7l:_llseek + */ +static void procfs_scan_listen(int fd, unsigned int lstate, + uint8_t *map, const uint8_t *exclude) +{ + struct lineread lr; + unsigned long port; + unsigned int state; + char *line; + + if (fd < 0) + return; + + if (lseek(fd, 0, SEEK_SET)) { + warn("lseek() failed on /proc/net file: %s", strerror(errno)); + return; + } + + lineread_init(&lr, fd); + lineread_get(&lr, &line); /* throw away header */ + while (lineread_get(&lr, &line) > 0) { + /* NOLINTNEXTLINE(cert-err34-c): != 2 if conversion fails */ + if (sscanf(line, "%*u: %*x:%lx %*x:%*x %x", &port, &state) != 2) + continue; + + if (state != lstate) + continue; + + if (bitmap_isset(exclude, port)) + bitmap_clear(map, port); + else + bitmap_set(map, port); + } +} + +/** + * fwd_scan_ports_tcp() - Scan /proc to update TCP forwarding map + * @fwd: Forwarding information to update + * @rev: Forwarding information for the reverse direction + */ +void fwd_scan_ports_tcp(struct fwd_ports *fwd, const struct fwd_ports *rev) +{ + memset(fwd->map, 0, PORT_BITMAP_SIZE); + procfs_scan_listen(fwd->scan4, TCP_LISTEN, fwd->map, rev->map); + procfs_scan_listen(fwd->scan6, TCP_LISTEN, fwd->map, rev->map); +} + +/** + * fwd_scan_ports_udp() - Scan /proc to update UDP forwarding map + * @fwd: Forwarding information to update + * @rev: Forwarding information for the reverse direction + * @tcp_fwd: Corresponding TCP forwarding information + * @tcp_rev: TCP forwarding information for the reverse direction + */ +void fwd_scan_ports_udp(struct fwd_ports *fwd, const struct fwd_ports *rev, + const struct fwd_ports *tcp_fwd, + const struct fwd_ports *tcp_rev) +{ + uint8_t exclude[PORT_BITMAP_SIZE]; + + bitmap_or(exclude, PORT_BITMAP_SIZE, rev->map, tcp_rev->map); + + memset(fwd->map, 0, PORT_BITMAP_SIZE); + procfs_scan_listen(fwd->scan4, UDP_LISTEN, fwd->map, exclude); + procfs_scan_listen(fwd->scan6, UDP_LISTEN, fwd->map, exclude); + + /* Also forward UDP ports with the same numbers as bound TCP ports. + * This is useful for a handful of protocols (e.g. iperf3) where a TCP + * control port is used to set up transfers on a corresponding UDP + * port. + * + * This means we need to skip numbers of TCP ports bound on the other + * side, too. Otherwise, we would detect corresponding UDP ports as + * bound and try to forward them from the opposite side, but it's + * already us handling them. + */ + procfs_scan_listen(tcp_fwd->scan4, TCP_LISTEN, fwd->map, exclude); + procfs_scan_listen(tcp_fwd->scan6, TCP_LISTEN, fwd->map, exclude); +} + +/** + * fwd_scan_ports_init() - Initial setup for automatic port forwarding + * @c: Execution context + */ +void fwd_scan_ports_init(struct ctx *c) +{ + const int flags = O_RDONLY | O_CLOEXEC; + + c->tcp.fwd_in.scan4 = c->tcp.fwd_in.scan6 = -1; + c->tcp.fwd_out.scan4 = c->tcp.fwd_out.scan6 = -1; + c->udp.fwd_in.f.scan4 = c->udp.fwd_in.f.scan6 = -1; + c->udp.fwd_out.f.scan4 = c->udp.fwd_out.f.scan6 = -1; + + if (c->tcp.fwd_in.mode == FWD_AUTO) { + c->tcp.fwd_in.scan4 = open_in_ns(c, "/proc/net/tcp", flags); + c->tcp.fwd_in.scan6 = open_in_ns(c, "/proc/net/tcp6", flags); + fwd_scan_ports_tcp(&c->tcp.fwd_in, &c->tcp.fwd_out); + } + if (c->udp.fwd_in.f.mode == FWD_AUTO) { + c->udp.fwd_in.f.scan4 = open_in_ns(c, "/proc/net/udp", flags); + c->udp.fwd_in.f.scan6 = open_in_ns(c, "/proc/net/udp6", flags); + fwd_scan_ports_udp(&c->udp.fwd_in.f, &c->udp.fwd_out.f, + &c->tcp.fwd_in, &c->tcp.fwd_out); + } + if (c->tcp.fwd_out.mode == FWD_AUTO) { + c->tcp.fwd_out.scan4 = open("/proc/net/tcp", flags); + c->tcp.fwd_out.scan6 = open("/proc/net/tcp6", flags); + fwd_scan_ports_tcp(&c->tcp.fwd_out, &c->tcp.fwd_in); + } + if (c->udp.fwd_out.f.mode == FWD_AUTO) { + c->udp.fwd_out.f.scan4 = open("/proc/net/udp", flags); + c->udp.fwd_out.f.scan6 = open("/proc/net/udp6", flags); + fwd_scan_ports_udp(&c->udp.fwd_out.f, &c->udp.fwd_in.f, + &c->tcp.fwd_out, &c->tcp.fwd_in); + } +} diff --git a/fwd.h b/fwd.h new file mode 100644 index 0000000..23281d9 --- /dev/null +++ b/fwd.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright Red Hat + * Author: Stefano Brivio + * Author: David Gibson + */ + +#ifndef FWD_H +#define FWD_H + +/* Number of ports for both TCP and UDP */ +#define NUM_PORTS (1U << 16) + +enum fwd_ports_mode { + FWD_SPEC = 1, + FWD_NONE, + FWD_AUTO, + FWD_ALL, +}; + +#define PORT_BITMAP_SIZE DIV_ROUND_UP(NUM_PORTS, 8) + +/** + * fwd_ports - Describes port forwarding for one protocol and direction + * @mode: Overall forwarding mode (all, none, auto, specific ports) + * @scan4: /proc/net fd to scan for IPv4 ports when in AUTO mode + * @scan6: /proc/net fd to scan for IPv6 ports when in AUTO mode + * @map: Bitmap describing which ports are forwarded + * @delta: Offset between the original destination and mapped port number + */ +struct fwd_ports { + enum fwd_ports_mode mode; + int scan4; + int scan6; + uint8_t map[PORT_BITMAP_SIZE]; + in_port_t delta[NUM_PORTS]; +}; + +void fwd_scan_ports_tcp(struct fwd_ports *fwd, const struct fwd_ports *rev); +void fwd_scan_ports_udp(struct fwd_ports *fwd, const struct fwd_ports *rev, + const struct fwd_ports *tcp_fwd, + const struct fwd_ports *tcp_rev); +void fwd_scan_ports_init(struct ctx *c); + +#endif /* FWD_H */ diff --git a/passt.h b/passt.h index fb729b6..e6d4358 100644 --- a/passt.h +++ b/passt.h @@ -39,7 +39,7 @@ union epoll_ref; #include "packet.h" #include "flow.h" #include "icmp.h" -#include "port_fwd.h" +#include "fwd.h" #include "tcp.h" #include "udp.h" diff --git a/port_fwd.c b/port_fwd.c deleted file mode 100644 index a7121fe..0000000 --- a/port_fwd.c +++ /dev/null @@ -1,155 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -/* PASST - Plug A Simple Socket Transport - * for qemu/UNIX domain socket mode - * - * PASTA - Pack A Subtle Tap Abstraction - * for network namespace/tap device mode - * - * port_fwd.c - Port forwarding helpers - * - * Copyright Red Hat - * Author: Stefano Brivio - * Author: David Gibson - */ - -#include -#include -#include -#include -#include -#include - -#include "util.h" -#include "port_fwd.h" -#include "passt.h" -#include "lineread.h" - -/* See enum in kernel's include/net/tcp_states.h */ -#define UDP_LISTEN 0x07 -#define TCP_LISTEN 0x0a - -/** - * procfs_scan_listen() - Set bits for listening TCP or UDP sockets from procfs - * @fd: fd for relevant /proc/net file - * @lstate: Code for listening state to scan for - * @map: Bitmap where numbers of ports in listening state will be set - * @exclude: Bitmap of ports to exclude from setting (and clear) - * - * #syscalls:pasta lseek - * #syscalls:pasta ppc64le:_llseek ppc64:_llseek armv6l:_llseek armv7l:_llseek - */ -static void procfs_scan_listen(int fd, unsigned int lstate, - uint8_t *map, const uint8_t *exclude) -{ - struct lineread lr; - unsigned long port; - unsigned int state; - char *line; - - if (fd < 0) - return; - - if (lseek(fd, 0, SEEK_SET)) { - warn("lseek() failed on /proc/net file: %s", strerror(errno)); - return; - } - - lineread_init(&lr, fd); - lineread_get(&lr, &line); /* throw away header */ - while (lineread_get(&lr, &line) > 0) { - /* NOLINTNEXTLINE(cert-err34-c): != 2 if conversion fails */ - if (sscanf(line, "%*u: %*x:%lx %*x:%*x %x", &port, &state) != 2) - continue; - - if (state != lstate) - continue; - - if (bitmap_isset(exclude, port)) - bitmap_clear(map, port); - else - bitmap_set(map, port); - } -} - -/** - * port_fwd_scan_tcp() - Scan /proc to update TCP forwarding map - * @fwd: Forwarding information to update - * @rev: Forwarding information for the reverse direction - */ -void port_fwd_scan_tcp(struct port_fwd *fwd, const struct port_fwd *rev) -{ - memset(fwd->map, 0, PORT_BITMAP_SIZE); - procfs_scan_listen(fwd->scan4, TCP_LISTEN, fwd->map, rev->map); - procfs_scan_listen(fwd->scan6, TCP_LISTEN, fwd->map, rev->map); -} - -/** - * port_fwd_scan_udp() - Scan /proc to update UDP forwarding map - * @fwd: Forwarding information to update - * @rev: Forwarding information for the reverse direction - * @tcp_fwd: Corresponding TCP forwarding information - * @tcp_rev: TCP forwarding information for the reverse direction - */ -void port_fwd_scan_udp(struct port_fwd *fwd, const struct port_fwd *rev, - const struct port_fwd *tcp_fwd, - const struct port_fwd *tcp_rev) -{ - uint8_t exclude[PORT_BITMAP_SIZE]; - - bitmap_or(exclude, PORT_BITMAP_SIZE, rev->map, tcp_rev->map); - - memset(fwd->map, 0, PORT_BITMAP_SIZE); - procfs_scan_listen(fwd->scan4, UDP_LISTEN, fwd->map, exclude); - procfs_scan_listen(fwd->scan6, UDP_LISTEN, fwd->map, exclude); - - /* Also forward UDP ports with the same numbers as bound TCP ports. - * This is useful for a handful of protocols (e.g. iperf3) where a TCP - * control port is used to set up transfers on a corresponding UDP - * port. - * - * This means we need to skip numbers of TCP ports bound on the other - * side, too. Otherwise, we would detect corresponding UDP ports as - * bound and try to forward them from the opposite side, but it's - * already us handling them. - */ - procfs_scan_listen(tcp_fwd->scan4, TCP_LISTEN, fwd->map, exclude); - procfs_scan_listen(tcp_fwd->scan6, TCP_LISTEN, fwd->map, exclude); -} - -/** - * port_fwd_init() - Initial setup for port forwarding - * @c: Execution context - */ -void port_fwd_init(struct ctx *c) -{ - const int flags = O_RDONLY | O_CLOEXEC; - - c->tcp.fwd_in.scan4 = c->tcp.fwd_in.scan6 = -1; - c->tcp.fwd_out.scan4 = c->tcp.fwd_out.scan6 = -1; - c->udp.fwd_in.f.scan4 = c->udp.fwd_in.f.scan6 = -1; - c->udp.fwd_out.f.scan4 = c->udp.fwd_out.f.scan6 = -1; - - if (c->tcp.fwd_in.mode == FWD_AUTO) { - c->tcp.fwd_in.scan4 = open_in_ns(c, "/proc/net/tcp", flags); - c->tcp.fwd_in.scan6 = open_in_ns(c, "/proc/net/tcp6", flags); - port_fwd_scan_tcp(&c->tcp.fwd_in, &c->tcp.fwd_out); - } - if (c->udp.fwd_in.f.mode == FWD_AUTO) { - c->udp.fwd_in.f.scan4 = open_in_ns(c, "/proc/net/udp", flags); - c->udp.fwd_in.f.scan6 = open_in_ns(c, "/proc/net/udp6", flags); - port_fwd_scan_udp(&c->udp.fwd_in.f, &c->udp.fwd_out.f, - &c->tcp.fwd_in, &c->tcp.fwd_out); - } - if (c->tcp.fwd_out.mode == FWD_AUTO) { - c->tcp.fwd_out.scan4 = open("/proc/net/tcp", flags); - c->tcp.fwd_out.scan6 = open("/proc/net/tcp6", flags); - port_fwd_scan_tcp(&c->tcp.fwd_out, &c->tcp.fwd_in); - } - if (c->udp.fwd_out.f.mode == FWD_AUTO) { - c->udp.fwd_out.f.scan4 = open("/proc/net/udp", flags); - c->udp.fwd_out.f.scan6 = open("/proc/net/udp6", flags); - port_fwd_scan_udp(&c->udp.fwd_out.f, &c->udp.fwd_in.f, - &c->tcp.fwd_out, &c->tcp.fwd_in); - } -} diff --git a/port_fwd.h b/port_fwd.h deleted file mode 100644 index f6bf1b5..0000000 --- a/port_fwd.h +++ /dev/null @@ -1,44 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later - * Copyright Red Hat - * Author: Stefano Brivio - * Author: David Gibson - */ - -#ifndef PORT_FWD_H -#define PORT_FWD_H - -/* Number of ports for both TCP and UDP */ -#define NUM_PORTS (1U << 16) - -enum port_fwd_mode { - FWD_SPEC = 1, - FWD_NONE, - FWD_AUTO, - FWD_ALL, -}; - -#define PORT_BITMAP_SIZE DIV_ROUND_UP(NUM_PORTS, 8) - -/** - * port_fwd - Describes port forwarding for one protocol and direction - * @mode: Overall forwarding mode (all, none, auto, specific ports) - * @scan4: /proc/net fd to scan for IPv4 ports when in AUTO mode - * @scan6: /proc/net fd to scan for IPv6 ports when in AUTO mode - * @map: Bitmap describing which ports are forwarded - * @delta: Offset between the original destination and mapped port number - */ -struct port_fwd { - enum port_fwd_mode mode; - int scan4; - int scan6; - uint8_t map[PORT_BITMAP_SIZE]; - in_port_t delta[NUM_PORTS]; -}; - -void port_fwd_scan_tcp(struct port_fwd *fwd, const struct port_fwd *rev); -void port_fwd_scan_udp(struct port_fwd *fwd, const struct port_fwd *rev, - const struct port_fwd *tcp_fwd, - const struct port_fwd *tcp_rev); -void port_fwd_init(struct ctx *c); - -#endif /* PORT_FWD_H */ diff --git a/tcp.c b/tcp.c index 2ea985e..560d1d4 100644 --- a/tcp.c +++ b/tcp.c @@ -3237,12 +3237,12 @@ void tcp_timer(struct ctx *c, const struct timespec *now) if (c->mode == MODE_PASTA) { if (c->tcp.fwd_out.mode == FWD_AUTO) { - port_fwd_scan_tcp(&c->tcp.fwd_out, &c->tcp.fwd_in); + fwd_scan_ports_tcp(&c->tcp.fwd_out, &c->tcp.fwd_in); NS_CALL(tcp_port_rebind_outbound, c); } if (c->tcp.fwd_in.mode == FWD_AUTO) { - port_fwd_scan_tcp(&c->tcp.fwd_in, &c->tcp.fwd_out); + fwd_scan_ports_tcp(&c->tcp.fwd_in, &c->tcp.fwd_out); tcp_port_rebind(c, false); } } diff --git a/tcp.h b/tcp.h index 5e6756d..a9b8bf8 100644 --- a/tcp.h +++ b/tcp.h @@ -59,8 +59,8 @@ union tcp_listen_epoll_ref { * @pipe_size: Size of pipes for spliced connections */ struct tcp_ctx { - struct port_fwd fwd_in; - struct port_fwd fwd_out; + struct fwd_ports fwd_in; + struct fwd_ports fwd_out; struct timespec timer_run; #ifdef HAS_SND_WND int kernel_snd_wnd; diff --git a/udp.c b/udp.c index 61ff87f..cb7c31f 100644 --- a/udp.c +++ b/udp.c @@ -259,7 +259,7 @@ void udp_portmap_clear(void) * udp_invert_portmap() - Compute reverse port translations for return packets * @fwd: Port forwarding configuration to compute reverse map for */ -static void udp_invert_portmap(struct udp_port_fwd *fwd) +static void udp_invert_portmap(struct udp_fwd_ports *fwd) { unsigned int i; @@ -1203,14 +1203,14 @@ void udp_timer(struct ctx *c, const struct timespec *now) if (c->mode == MODE_PASTA) { if (c->udp.fwd_out.f.mode == FWD_AUTO) { - port_fwd_scan_udp(&c->udp.fwd_out.f, &c->udp.fwd_in.f, - &c->tcp.fwd_out, &c->tcp.fwd_in); + fwd_scan_ports_udp(&c->udp.fwd_out.f, &c->udp.fwd_in.f, + &c->tcp.fwd_out, &c->tcp.fwd_in); NS_CALL(udp_port_rebind_outbound, c); } if (c->udp.fwd_in.f.mode == FWD_AUTO) { - port_fwd_scan_udp(&c->udp.fwd_in.f, &c->udp.fwd_out.f, - &c->tcp.fwd_in, &c->tcp.fwd_out); + fwd_scan_ports_udp(&c->udp.fwd_in.f, &c->udp.fwd_out.f, + &c->tcp.fwd_in, &c->tcp.fwd_out); udp_port_rebind(c, false); } } diff --git a/udp.h b/udp.h index f3d5d6d..9976b62 100644 --- a/udp.h +++ b/udp.h @@ -43,12 +43,12 @@ union udp_epoll_ref { /** - * udp_port_fwd - UDP specific port forwarding configuration + * udp_fwd_ports - UDP specific port forwarding configuration * @f: Generic forwarding configuration * @rdelta: Reversed delta map to translate source ports on return packets */ -struct udp_port_fwd { - struct port_fwd f; +struct udp_fwd_ports { + struct fwd_ports f; in_port_t rdelta[NUM_PORTS]; }; @@ -59,8 +59,8 @@ struct udp_port_fwd { * @timer_run: Timestamp of most recent timer run */ struct udp_ctx { - struct udp_port_fwd fwd_in; - struct udp_port_fwd fwd_out; + struct udp_fwd_ports fwd_in; + struct udp_fwd_ports fwd_out; struct timespec timer_run; }; -- cgit v1.2.3