[Openvpn-devel,v2] push: remove dead code

Message ID 20261125171133.21392-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v2] push: remove dead code |

Commit Message

Gert Doering Nov. 25, 2026, 5:11 p.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

- push_option_ex(): drop the "enable" parameter; it was ignored and
  every caller passed true.
- push_remove_option(): drop the NULL check on o, already dereferenced
  by the ifconfig/ifconfig-ipv6 checks above it.
- receive_auth_failed(): drop a repeated no_advance = true and a BLEN()
  check implied by the preceding "CRV1:" prefix match, and the blank
  line hiding that the auth-token check is an else-if of the TEMP one.

Change-Id: I0f659eb20441edd411ec13f4d09f434141b2da32
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2344
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2344
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>
  

Patch

diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index eb11107..274f652 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -75,7 +75,6 @@ 
         parse_auth_failed_temp(&c->options, reason + strlen("TEMP"));
         register_signal(c->sig, SIGUSR1, "auth-temp-failure (server temporary reject)");
     }
-
     /* Before checking how to react on AUTH_FAILED, first check if the
      * failed auth might be the result of an expired auth-token.
      * Note that a server restart will trigger a generic AUTH_FAILED
@@ -85,7 +84,6 @@ 
     {
         /* SOFT-SIGUSR1 -- Auth failure error */
         register_signal(c->sig, SIGUSR1, "auth-failure (auth-token)");
-        c->options.no_advance = true;
     }
     else
     {
@@ -117,7 +115,7 @@ 
     /*
      * Save the dynamic-challenge text even when management is defined
      */
-    if (authfail_extended && buf_string_match_head_str(&buf, "CRV1:") && BLEN(&buf))
+    if (authfail_extended && buf_string_match_head_str(&buf, "CRV1:"))
     {
         ssl_put_auth_challenge(CBSTR(&buf));
     }
@@ -931,7 +929,7 @@ 
 }
 
 static void
-push_option_ex(struct gc_arena *gc, struct push_list *push_list, const char *opt, bool enable,
+push_option_ex(struct gc_arena *gc, struct push_list *push_list, const char *opt,
                msglvl_t msglevel)
 {
     if (!string_class(opt, CC_ANY, CC_COMMA))
@@ -962,7 +960,7 @@ 
 void
 push_option(struct options *o, const char *opt, msglvl_t msglevel)
 {
-    push_option_ex(&o->gc, &o->push_list, opt, true, msglevel);
+    push_option_ex(&o->gc, &o->push_list, opt, msglevel);
 }
 
 void
@@ -974,7 +972,7 @@ 
         push_reset(o);
         while (e)
         {
-            push_option_ex(&o->gc, &o->push_list, string_alloc(e->option, &o->gc), true, M_FATAL);
+            push_option_ex(&o->gc, &o->push_list, string_alloc(e->option, &o->gc), M_FATAL);
             e = e->next;
         }
     }
@@ -1002,7 +1000,7 @@ 
     {
         return false;
     }
-    push_option_ex(gc, push_list, string_alloc(tmp, gc), true, msglevel);
+    push_option_ex(gc, push_list, string_alloc(tmp, gc), msglevel);
     return true;
 }
 
@@ -1031,7 +1029,7 @@ 
         return;
     }
 
-    if (o && o->push_list.head)
+    if (o->push_list.head)
     {
         struct push_entry *e = o->push_list.head;