diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-07-18 15:26:49 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-07-19 18:33:48 +0200 |
commit | b7ad19347fd7e5b0be740159fcb822e6b55ab255 (patch) | |
tree | acbdeb1753b54cc066aaf2e0b7f0185c57fc4474 /udp.h | |
parent | 8126f7a66009f3caaf54ed5044b0eabd5ced61a2 (diff) | |
download | passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.tar passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.tar.gz passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.tar.bz2 passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.tar.lz passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.tar.xz passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.tar.zst passt-b7ad19347fd7e5b0be740159fcb822e6b55ab255.zip |
udp: Find or create flows for datagrams from tap interface
Currently we create flows for datagrams from socket interfaces, and use
them to direct "spliced" (socket to socket) datagrams. We don't yet
match datagrams from the tap interface to existing flows, nor create new
flows for them. Add that functionality, matching datagrams from tap to
existing flows when they exist, or creating new ones.
As with spliced flows, when creating a new flow from tap to socket, we
create a new connected socket to receive reply datagrams attached to that
flow specifically. We extend udp_flow_sock_handler() to handle reply
packets bound for tap rather than another socket.
For non-obvious reasons (perhaps increased stack usage?), this caused
a failure for me when running under valgrind, because valgrind invoked
rt_sigreturn which is not in our seccomp filter. Since we already
allow rt_sigaction and others in the valgrind target, it seems
reasonable to add rt_sigreturn as well.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'udp.h')
-rw-r--r-- | udp.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -13,8 +13,8 @@ void udp_buf_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events, const struct timespec *now); void udp_reply_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events, const struct timespec *now); -int udp_tap_handler(struct ctx *c, uint8_t pif, sa_family_t af, - const void *saddr, const void *daddr, +int udp_tap_handler(const struct ctx *c, uint8_t pif, + sa_family_t af, const void *saddr, const void *daddr, const struct pool *p, int idx, const struct timespec *now); int udp_sock_init(const struct ctx *c, int ns, sa_family_t af, const void *addr, const char *ifname, in_port_t port); |