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
1 changed files with 2 additions and 1 deletions
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 a new issue