mirror of
https://passt.top/passt
synced 2024-12-22 13:45:32 +00:00
Revert "udp: Make rport calculation more local"
This reverts commitc80fa6a6bb
, as it reintroduces the issue fixed by commit1e6f92b995
("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>
This commit is contained in:
parent
c66f0341d9
commit
054697598f
3
udp.c
3
udp.c
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user