mirror of
https://passt.top/passt
synced 2025-05-28 12:25:34 +02:00
udp: Remove rdelta port forwarding maps
In addition to the struct fwd_ports used by both UDP and TCP to track port forwarding, UDP also included an 'rdelta' field, which contained the reverse mapping of the main port map. This was used so that we could properly direct reply packets to a forwarded packet where we change the destination port. This has now been taken over by the flow table: reply packets will match the flow of the originating packet, and that gives the correct ports on the originating side. So, eliminate the rdelta field, and with it struct udp_fwd_ports, which now has no additional information over struct fwd_ports. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
d89b3aa097
commit
d29fa0856e
4 changed files with 27 additions and 67 deletions
14
conf.c
14
conf.c
|
@ -1248,7 +1248,7 @@ void conf(struct ctx *c, int argc, char **argv)
|
|||
}
|
||||
|
||||
c->tcp.fwd_in.mode = c->tcp.fwd_out.mode = FWD_UNSET;
|
||||
c->udp.fwd_in.f.mode = c->udp.fwd_out.f.mode = FWD_UNSET;
|
||||
c->udp.fwd_in.mode = c->udp.fwd_out.mode = FWD_UNSET;
|
||||
|
||||
do {
|
||||
name = getopt_long(argc, argv, optstring, options, NULL);
|
||||
|
@ -1664,7 +1664,7 @@ void conf(struct ctx *c, int argc, char **argv)
|
|||
if (name == 't')
|
||||
conf_ports(c, name, optarg, &c->tcp.fwd_in);
|
||||
else if (name == 'u')
|
||||
conf_ports(c, name, optarg, &c->udp.fwd_in.f);
|
||||
conf_ports(c, name, optarg, &c->udp.fwd_in);
|
||||
} while (name != -1);
|
||||
|
||||
if (c->mode == MODE_PASTA)
|
||||
|
@ -1699,7 +1699,7 @@ void conf(struct ctx *c, int argc, char **argv)
|
|||
if (name == 'T')
|
||||
conf_ports(c, name, optarg, &c->tcp.fwd_out);
|
||||
else if (name == 'U')
|
||||
conf_ports(c, name, optarg, &c->udp.fwd_out.f);
|
||||
conf_ports(c, name, optarg, &c->udp.fwd_out);
|
||||
} while (name != -1);
|
||||
|
||||
if (!c->ifi4)
|
||||
|
@ -1726,10 +1726,10 @@ void conf(struct ctx *c, int argc, char **argv)
|
|||
c->tcp.fwd_in.mode = fwd_default;
|
||||
if (!c->tcp.fwd_out.mode)
|
||||
c->tcp.fwd_out.mode = fwd_default;
|
||||
if (!c->udp.fwd_in.f.mode)
|
||||
c->udp.fwd_in.f.mode = fwd_default;
|
||||
if (!c->udp.fwd_out.f.mode)
|
||||
c->udp.fwd_out.f.mode = fwd_default;
|
||||
if (!c->udp.fwd_in.mode)
|
||||
c->udp.fwd_in.mode = fwd_default;
|
||||
if (!c->udp.fwd_out.mode)
|
||||
c->udp.fwd_out.mode = fwd_default;
|
||||
|
||||
fwd_scan_ports_init(c);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue