]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove dead PID_TEST code
authorArne Schwabe <arne@rfc2549.org>
Fri, 22 Apr 2022 13:40:31 +0000 (15:40 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 22 Apr 2022 16:07:06 +0000 (18:07 +0200)
Enabling this test produces compile errors and by the looks of it the
test has been broken for many years.
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220422134038.3801239-3-arne@rfc2549.org>
URL: https://www.mail-archive.com/search?l=mid&q=20220422134038.3801239-3-arne@rfc2549.org

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c
src/openvpn/packet_id.c
src/openvpn/packet_id.h

index b233b9d86130596fbefdf0bb08c00aad296c5a1d..af2bc1be55a5283b05add5ff2e29ab4e045f6aa1 100644 (file)
@@ -791,11 +791,6 @@ init_static(void)
 
     init_ssl_lib();
 
-#ifdef PID_TEST
-    packet_id_interactive_test();       /* test the sequence number code */
-    return false;
-#endif
-
 #ifdef SCHEDULE_TEST
     schedule_test();
     return false;
index 4943203095c37d3765174e215305fcaf82a8e4d5..e357909d7fd10325434d339389ae4d26a150f1a1 100644 (file)
@@ -634,59 +634,3 @@ packet_id_debug_print(int msglevel,
 }
 
 #endif /* ifdef ENABLE_DEBUG */
-
-#ifdef PID_TEST
-
-void
-packet_id_interactive_test(void)
-{
-    struct packet_id pid;
-    struct packet_id_net pin;
-    bool long_form;
-    bool count = 0;
-    bool test;
-
-    const int seq_backtrack = 10;
-    const int time_backtrack = 10;
-
-    packet_id_init(&pid, seq_backtrack, time_backtrack);
-
-    while (true)
-    {
-        char buf[80];
-        if (!fgets(buf, sizeof(buf), stdin))
-        {
-            break;
-        }
-        update_time();
-        if (sscanf(buf, "%lu,%u", &pin.time, &pin.id) == 2)
-        {
-            packet_id_reap_test(&pid.rec);
-            test = packet_id_test(&pid.rec, &pin);
-            printf("packet_id_test (%" PRIi64 ", " packet_id_format ") returned %d\n",
-                   (int64_t)pin.time,
-                   (packet_id_print_type)pin.id,
-                   test);
-            if (test)
-            {
-                packet_id_add(&pid.rec, &pin);
-            }
-        }
-        else
-        {
-            long_form = (count < 20);
-            packet_id_alloc_outgoing(&pid.send, &pin, long_form);
-            printf("(%" PRIi64 "(" packet_id_format "), %d)\n",
-                   (int64_t)pin.time,
-                   (packet_id_print_type)pin.id,
-                   long_form);
-            if (pid.send.id == 10)
-            {
-                pid.send.id = 0xFFFFFFF8;
-            }
-            ++count;
-        }
-    }
-    packet_id_free(&pid);
-}
-#endif /* ifdef PID_TEST */
index bb613282e7806425ed5624a583affb089a033b1c..410071e26038f68ec63dd851909fcaa2227d31f1 100644 (file)
 #include "error.h"
 #include "otime.h"
 
-/*
- * Enables OpenVPN to be compiled in special packet_id test mode.
- */
-/*#define PID_TEST*/
-
 #if 1
 /*
  * These are the types that members of
@@ -296,11 +291,6 @@ packet_id_persist_save_obj(struct packet_id_persist *p, const struct packet_id *
 
 const char *packet_id_net_print(const struct packet_id_net *pin, bool print_timestamp, struct gc_arena *gc);
 
-#ifdef PID_TEST
-void packet_id_interactive_test(void);
-
-#endif
-
 static inline int
 packet_id_size(bool long_form)
 {