aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-07-18 15:26:52 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-07-19 18:33:57 +0200
commitd29fa0856e75816431e78552821ec77c59e25b3e (patch)
tree9117d52ad3ed4159cdf821d95509979d005dd688 /conf.c
parentd89b3aa097a6777e981a4eb537a0b37f08a5b3a7 (diff)
downloadpasst-d29fa0856e75816431e78552821ec77c59e25b3e.tar
passt-d29fa0856e75816431e78552821ec77c59e25b3e.tar.gz
passt-d29fa0856e75816431e78552821ec77c59e25b3e.tar.bz2
passt-d29fa0856e75816431e78552821ec77c59e25b3e.tar.lz
passt-d29fa0856e75816431e78552821ec77c59e25b3e.tar.xz
passt-d29fa0856e75816431e78552821ec77c59e25b3e.tar.zst
passt-d29fa0856e75816431e78552821ec77c59e25b3e.zip
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>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/conf.c b/conf.c
index 629eb89..3cf9ed8 100644
--- a/conf.c
+++ b/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);