diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2024-06-21 13:59:48 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-24 15:41:38 +0200 |
commit | 054697598f97be70d9244c604db44d1ea230c133 (patch) | |
tree | e9b98d4e0b1a45bcfae4c10f4a7857293a4c6199 | |
parent | c66f0341d94d255e647cca8c4b35192f0f32e181 (diff) | |
download | passt-054697598f97be70d9244c604db44d1ea230c133.tar passt-054697598f97be70d9244c604db44d1ea230c133.tar.gz passt-054697598f97be70d9244c604db44d1ea230c133.tar.bz2 passt-054697598f97be70d9244c604db44d1ea230c133.tar.lz passt-054697598f97be70d9244c604db44d1ea230c133.tar.xz passt-054697598f97be70d9244c604db44d1ea230c133.tar.zst passt-054697598f97be70d9244c604db44d1ea230c133.zip |
Revert "udp: Make rport calculation more local"
This reverts commit c80fa6a6bb4415ad48f9e11424310875d0d99bc7, as it
reintroduces the issue fixed by commit 1e6f92b995a9 ("udp: Fix 16-bit
overflow in udp_invert_portmap()").
Reported-by: Laurent Jacquot <jk@lutty.net>
Link: https://bugs.passt.top/show_bug.cgi?id=80
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | udp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -279,9 +279,10 @@ static void udp_invert_portmap(struct udp_fwd_ports *fwd) "Forward and reverse delta arrays must have same size"); for (i = 0; i < ARRAY_SIZE(fwd->f.delta); i++) { in_port_t delta = fwd->f.delta[i]; + in_port_t rport = i + delta; if (delta) - fwd->rdelta[i + delta] = NUM_PORTS - delta; + fwd->rdelta[rport] = NUM_PORTS - delta; } } |