aboutgitcodebugslistschat
path: root/udp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-21 04:42:09 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-21 04:42:09 +0200
commit85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26 (patch)
treec678c54328804eb197a95571d6ce53a56c453d69 /udp.c
parentdd942eaa480a0744fd64844f34233900a0da6893 (diff)
downloadpasst-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.tar
passt-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.tar.gz
passt-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.tar.bz2
passt-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.tar.lz
passt-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.tar.xz
passt-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.tar.zst
passt-85a80f8f63f9f6d6184afb5c06cfd3b43fc86e26.zip
udp: Fix maximum payload size calculation for IPv4 buffers, bump UDP_TAP_FRAMES
The issue with a higher UDP_TAP_FRAMES was actually coming from a payload size the guest couldn't digest. Fix that, and bump UDP_TAP_FRAMES back to 128. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/udp.c b/udp.c
index 67d723d..d958c27 100644
--- a/udp.c
+++ b/udp.c
@@ -120,7 +120,7 @@
#define UDP_CONN_TIMEOUT 180 /* s, timeout for ephemeral or local bind */
#define UDP_SPLICE_FRAMES 128
-#define UDP_TAP_FRAMES 16
+#define UDP_TAP_FRAMES 128
/**
* struct udp_tap_port - Port tracking based on tap-facing source port
@@ -201,7 +201,8 @@ __extension__ static struct udp4_l2_buf_t {
struct ethhdr eh;
struct iphdr iph;
struct udphdr uh;
- uint8_t data[USHRT_MAX - sizeof(struct udphdr)];
+ uint8_t data[USHRT_MAX -
+ (sizeof(struct iphdr) + sizeof(struct udphdr))];
} __attribute__ ((packed, aligned(__alignof__(unsigned int))))
udp4_l2_buf[UDP_TAP_FRAMES] = {
[ 0 ... UDP_TAP_FRAMES - 1 ] = {