diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-30 15:13:06 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-12-06 07:41:31 +0100 |
commit | d9394eb9b7d84b90169f32242611009735996a75 (patch) | |
tree | 2f3fdc4a189bf39883e95d7e58c29ce66cad766b /udp.h | |
parent | 85172392435613c8b5145c1fb36ce6e134851c7d (diff) | |
download | passt-d9394eb9b7d84b90169f32242611009735996a75.tar passt-d9394eb9b7d84b90169f32242611009735996a75.tar.gz passt-d9394eb9b7d84b90169f32242611009735996a75.tar.bz2 passt-d9394eb9b7d84b90169f32242611009735996a75.tar.lz passt-d9394eb9b7d84b90169f32242611009735996a75.tar.xz passt-d9394eb9b7d84b90169f32242611009735996a75.tar.zst passt-d9394eb9b7d84b90169f32242611009735996a75.zip |
udp: Split splice field in udp_epoll_ref into (mostly) independent bits
The @splice field in union udp_epoll_ref can have a number of values for
different types of "spliced" packet flows. Split it into several single
bit fields with more or less independent meanings. The new @splice field
is just a boolean indicating whether the socket is associated with a
spliced flow, making it identical to the @splice fiend in tcp_epoll_ref.
The new bit @orig, indicates whether this is a socket which can originate
new udp packet flows (created with -u or -U) or a socket created on the
fly to handle reply socket. @ns indicates whether the socket lives in the
init namespace or the pasta namespace.
Making these bits more orthogonal to each other will simplify some future
cleanups.
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 | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -23,20 +23,19 @@ void udp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s, * union udp_epoll_ref - epoll reference portion for TCP connections * @bound: Set if this file descriptor is a bound socket * @splice: Set if descriptor is associated to "spliced" connection + * @orig: Set if a spliced socket which can originate "connections" + * @ns: Set if this is a socket in the pasta network namespace * @v6: Set for IPv6 sockets or connections * @port: Source port for connected sockets, bound port otherwise * @u32: Opaque u32 value of reference */ union udp_epoll_ref { struct { - uint32_t splice:3, -#define UDP_TO_NS 1 -#define UDP_TO_INIT 2 -#define UDP_BACK_TO_NS 3 -#define UDP_BACK_TO_INIT 4 - - v6:1, - port:16; + bool splice:1, + orig:1, + ns:1, + v6:1; + uint32_t port:16; } udp; uint32_t u32; }; |