Usually udp_sock_handler() will receive and forward multiple (up to 32)
datagrams in udp_sock_handler(), then forward them all to the tap
interface. For unclear reasons, though, when in pasta mode we will only
receive and forward a single datagram at a time. Change it to receive
multiple datagrams at once, like the other paths.
Signed-off-by: David Gibson
---
udp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/udp.c b/udp.c
index 64c9219..24fa984 100644
--- a/udp.c
+++ b/udp.c
@@ -119,7 +119,6 @@
#define UDP_CONN_TIMEOUT 180 /* s, timeout for ephemeral or local bind */
#define UDP_MAX_FRAMES 32 /* max # of frames to receive at once */
-#define UDP_TAP_FRAMES (c->mode == MODE_PASST ? UDP_MAX_FRAMES : 1)
/**
* struct udp_tap_port - Port tracking based on tap-facing source port
@@ -968,7 +967,7 @@ void udp_sock_handler(const struct ctx *c, union epoll_ref ref, uint32_t events,
else
sock_mmh = udp4_l2_mh_sock;
- n = recvmmsg(ref.r.s, sock_mmh, UDP_TAP_FRAMES, 0, NULL);
+ n = recvmmsg(ref.r.s, sock_mmh, UDP_MAX_FRAMES, 0, NULL);
if (n <= 0)
return;
--
2.38.1