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
---
fwd.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/fwd.c b/fwd.c
index c5090fb1..9e455094 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);
- }
}
/**
--
2.53.0