]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
options: drop useless netmask variable
authorAntonio Quartulli <a@unstable.cc>
Mon, 14 Mar 2022 13:13:56 +0000 (14:13 +0100)
committerGert Doering <gert@greenie.muc.de>
Thu, 17 Mar 2022 11:07:55 +0000 (12:07 +0100)
netmask is simply used to reflect the value of p[2], therefore
it can be dropped and p[2] can directly be used instead.

Reported-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220314131356.11577-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23941.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index 7ce0ba613a9d983efb94ba369d427acb14f03dc0..7d7b8dc1fc1b8f6a5f0ed448d2d2aea6e604fceb 100644 (file)
@@ -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])
     {