aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-03-11 23:03:08 +1100
committerStefano Brivio <sbrivio@redhat.com>2026-03-11 22:11:30 +0100
commit4fa0076956fc87146b530e27f1129acfaed70025 (patch)
tree3feb72564b932a91290bc7c7c9c9b4da4df1d3bb
parentd2438efb69558877a0b306247dbcba5ecbd5b794 (diff)
downloadpasst-4fa0076956fc87146b530e27f1129acfaed70025.tar
passt-4fa0076956fc87146b530e27f1129acfaed70025.tar.gz
passt-4fa0076956fc87146b530e27f1129acfaed70025.tar.bz2
passt-4fa0076956fc87146b530e27f1129acfaed70025.tar.lz
passt-4fa0076956fc87146b530e27f1129acfaed70025.tar.xz
passt-4fa0076956fc87146b530e27f1129acfaed70025.tar.zst
passt-4fa0076956fc87146b530e27f1129acfaed70025.zip
fwd: Don't initialise unused port bitmaps
Since b223bec48213 ("fwd, tcp, udp: Set up listening sockets based on forward table"), the 'map' field of struct fwd_ports has only been used for forwarding rules with the FWD_SCAN bit, where it is initialised from a port scan. However, we still pointlessly initialise it for rules with !FWD_SCAN. Remove the unneeded code. Fixes: b223bec48213 ("fwd, tcp, udp: Set up listening sockets based on forward table") Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--fwd.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fwd.c b/fwd.c
index c5090fb..9e45509 100644
--- a/fwd.c
+++ b/fwd.c
@@ -405,13 +405,8 @@ void fwd_rule_add(struct fwd_ports *fwd, uint8_t flags,
new->socks = &fwd->socks[fwd->sock_count];
fwd->sock_count += num;
- for (port = new->first; port <= new->last; port++) {
+ for (port = new->first; port <= new->last; port++)
new->socks[port - new->first] = -1;
-
- /* Fill in the legacy forwarding data structures to match the table */
- if (!(new->flags & FWD_SCAN))
- bitmap_set(fwd->map, port);
- }
}
/**