Browse code

Remove ENABLE_PUSH_PEER_INFO

ENABLE_PUSH_PEER_INFO depended on ENABLE_CRYPTO that now does
not exist anymore.
Get rid of ENABLE_PUSH_PEER_INFO by assuming that it is always
enabled and simplify the code.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <20171202134541.7688-3-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15953.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Antonio Quartulli authored on 2017/12/02 22:45:37
Showing 6 changed files
... ...
@@ -2686,7 +2686,6 @@ do_init_crypto_tls(struct context *c, const unsigned int flags)
2686 2686
     to.single_session = options->single_session;
2687 2687
     to.mode = options->mode;
2688 2688
     to.pull = options->pull;
2689
-#ifdef ENABLE_PUSH_PEER_INFO
2690 2689
     if (options->push_peer_info)        /* all there is */
2691 2690
     {
2692 2691
         to.push_peer_info_detail = 2;
... ...
@@ -2699,7 +2698,6 @@ do_init_crypto_tls(struct context *c, const unsigned int flags)
2699 2699
     {
2700 2700
         to.push_peer_info_detail = 0;
2701 2701
     }
2702
-#endif
2703 2702
 
2704 2703
     /* should we not xmit any packets until we get an initial
2705 2704
      * response from client? */
... ...
@@ -225,9 +225,7 @@ static const char usage_message[] =
225 225
     "--redirect-private [flags]: Like --redirect-gateway, but omit actually changing\n"
226 226
     "                  the default gateway.  Useful when pushing private subnets.\n"
227 227
     "--client-nat snat|dnat network netmask alias : on client add 1-to-1 NAT rule.\n"
228
-#ifdef ENABLE_PUSH_PEER_INFO
229 228
     "--push-peer-info : (client only) push client info to server.\n"
230
-#endif
231 229
     "--setenv name value : Set a custom environmental variable to pass to script.\n"
232 230
     "--setenv FORWARD_COMPATIBLE 1 : Relax config file syntax checking to allow\n"
233 231
     "                  directives for future OpenVPN versions to be ignored.\n"
... ...
@@ -1772,9 +1770,7 @@ show_settings(const struct options *o)
1772 1772
     SHOW_INT(transition_window);
1773 1773
 
1774 1774
     SHOW_BOOL(single_session);
1775
-#ifdef ENABLE_PUSH_PEER_INFO
1776 1775
     SHOW_BOOL(push_peer_info);
1777
-#endif
1778 1776
     SHOW_BOOL(tls_exit);
1779 1777
 
1780 1778
     SHOW_STR(tls_auth_file);
... ...
@@ -2732,9 +2728,7 @@ options_postprocess_verify_ce(const struct options *options, const struct connec
2732 2732
         MUST_BE_UNDEF(tls_auth_file);
2733 2733
         MUST_BE_UNDEF(tls_crypt_file);
2734 2734
         MUST_BE_UNDEF(single_session);
2735
-#ifdef ENABLE_PUSH_PEER_INFO
2736 2735
         MUST_BE_UNDEF(push_peer_info);
2737
-#endif
2738 2736
         MUST_BE_UNDEF(tls_exit);
2739 2737
         MUST_BE_UNDEF(crl_file);
2740 2738
         MUST_BE_UNDEF(key_method);
... ...
@@ -6344,12 +6338,10 @@ add_option(struct options *options,
6344 6344
             msg(msglevel, "this is a generic configuration and cannot directly be used");
6345 6345
             goto err;
6346 6346
         }
6347
-#ifdef ENABLE_PUSH_PEER_INFO
6348 6347
         else if (streq(p[1], "PUSH_PEER_INFO") && !p[2])
6349 6348
         {
6350 6349
             options->push_peer_info = true;
6351 6350
         }
6352
-#endif
6353 6351
         else if (streq(p[1], "SERVER_POLL_TIMEOUT") && p[2])
6354 6352
         {
6355 6353
             options->ce.connect_timeout = positive_atoi(p[2]);
... ...
@@ -7778,13 +7770,11 @@ add_option(struct options *options,
7778 7778
         VERIFY_PERMISSION(OPT_P_GENERAL);
7779 7779
         options->single_session = true;
7780 7780
     }
7781
-#ifdef ENABLE_PUSH_PEER_INFO
7782 7781
     else if (streq(p[0], "push-peer-info") && !p[1])
7783 7782
     {
7784 7783
         VERIFY_PERMISSION(OPT_P_GENERAL);
7785 7784
         options->push_peer_info = true;
7786 7785
     }
7787
-#endif
7788 7786
     else if (streq(p[0], "tls-exit") && !p[1])
7789 7787
     {
7790 7788
         VERIFY_PERMISSION(OPT_P_GENERAL);
... ...
@@ -569,9 +569,7 @@ struct options
569 569
     /* Allow only one session */
570 570
     bool single_session;
571 571
 
572
-#ifdef ENABLE_PUSH_PEER_INFO
573 572
     bool push_peer_info;
574
-#endif
575 573
 
576 574
     bool tls_exit;
577 575
 
... ...
@@ -2235,7 +2235,6 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
2235 2235
     struct gc_arena gc = gc_new();
2236 2236
     bool ret = false;
2237 2237
 
2238
-#ifdef ENABLE_PUSH_PEER_INFO
2239 2238
     if (session->opt->push_peer_info_detail > 0)
2240 2239
     {
2241 2240
         struct env_set *es = session->opt->es;
... ...
@@ -2316,7 +2315,6 @@ push_peer_info(struct buffer *buf, struct tls_session *session)
2316 2316
         }
2317 2317
     }
2318 2318
     else
2319
-#endif /* ifdef ENABLE_PUSH_PEER_INFO */
2320 2319
     {
2321 2320
         if (!write_empty_string(buf)) /* no peer info */
2322 2321
         {
... ...
@@ -249,9 +249,7 @@ struct tls_options
249 249
 #endif
250 250
     int mode;
251 251
     bool pull;
252
-#ifdef ENABLE_PUSH_PEER_INFO
253 252
     int push_peer_info_detail;
254
-#endif
255 253
     int transition_window;
256 254
     int handshake_window;
257 255
     interval_t packet_timeout;
... ...
@@ -674,11 +674,6 @@ socket_defined(const socket_descriptor_t sd)
674 674
 #endif
675 675
 
676 676
 /*
677
- * Do we support pushing peer info?
678
- */
679
-#define ENABLE_PUSH_PEER_INFO
680
-
681
-/*
682 677
  * Compression support
683 678
  */
684 679
 #if defined(ENABLE_LZO) || defined(ENABLE_LZ4)    \