Skip to contentSkip to conversation

options: drop useless netmask variable

PATCH In review Antonio Quartulli 2 participants 2 messages Mar 14, 2022 – Mar 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 options: drop useless netmask variable

netmask is simply used to reflect the value of p[2], therefore it can be dropped and p[2] can directly be used instead.

---
 src/openvpn/options.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
src/openvpn/options.c +1 -7
index 7ce0ba61..7d7b8dc1 100644
@@ -7282,14 +7282,8 @@ add_option(struct options *options,
     }
     else if (streq(p[0], "iroute") && p[1] && !p[3])
     {
-        const char *netmask = NULL;
-
         VERIFY_PERMISSION(OPT_P_INSTANCE);
-        if (p[2])
-        {
-            netmask = p[2];
-        }
-        option_iroute(options, p[1], netmask, msglevel);
+        option_iroute(options, p[1], p[2], msglevel);
     }
     else if (streq(p[0], "iroute-ipv6") && p[1] && !p[2])
     {
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Trivial change, obviously correct. I *did* test-compile this :-) but did not actually test any iroute stuff (that will come next in the "DCO server" testbed).

Your patch has been applied to the master branch.

commit 07be493796250ad680a4a41c26e19c1938bf37ce

Author: Antonio Quartulli
Date:   Mon Mar 14 14:13:56 2022 +0100
     options: drop useless netmask variable

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg23941.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering