openswan-2.4.9-005-pluto.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. diff -urp openswan-2.4.7.orig/programs/pluto/connections.c openswan-2.4.7/programs/pluto/connections.c
  2. --- openswan-2.4.7.orig/programs/pluto/connections.c 2006-09-04 19:00:01.000000000 +0200
  3. +++ openswan-2.4.7/programs/pluto/connections.c 2006-11-28 16:53:33.000000000 +0100
  4. @@ -2084,10 +2084,10 @@ initiate_connection(const char *name, in
  5. if (c != NULL)
  6. {
  7. set_cur_connection(c);
  8. -
  9. +#ifdef DEBUG
  10. /* turn on any extra debugging asked for */
  11. c->extra_debugging |= moredebug;
  12. -
  13. +#endif
  14. if (!oriented(*c))
  15. {
  16. loglog(RC_ORIENT, "We cannot identify ourselves with either end of this connection.");
  17. @@ -2577,6 +2577,7 @@ initiate_opportunistic_body(struct find_
  18. ourport = ntohs(portof(&b->our_client));
  19. hisport = ntohs(portof(&b->peer_client));
  20. +#ifdef DEBUG
  21. snprintf(demandbuf, 256, "initiate on demand from %s:%d to %s:%d proto=%d state: %s because: %s"
  22. , ours, ourport, his, hisport, b->transport_proto
  23. , oppo_step_name[b->step], b->want);
  24. @@ -2588,7 +2589,7 @@ initiate_opportunistic_body(struct find_
  25. whack_log(RC_COMMENT, "%s", demandbuf);
  26. loggedit = TRUE;
  27. }
  28. -
  29. +#endif
  30. if (isanyaddr(&b->our_client) || isanyaddr(&b->peer_client))
  31. {
  32. cannot_oppo(NULL, b, "impossible IP address");
  33. @@ -4465,6 +4467,7 @@ show_connections_status(void)
  34. , c->dpd_delay, c->dpd_timeout);
  35. }
  36. +#ifdef DEBUG
  37. if(c->extra_debugging) {
  38. whack_log(RC_COMMENT, "\"%s\"%s: debug: %s"
  39. , c->name
  40. @@ -4472,6 +4475,7 @@ show_connections_status(void)
  41. , bitnamesof(debug_bit_names
  42. , c->extra_debugging));
  43. }
  44. +#endif
  45. whack_log(RC_COMMENT
  46. , "\"%s\"%s: newest ISAKMP SA: #%ld; newest IPsec SA: #%ld; "
  47. diff -urp openswan-2.4.7.orig/programs/pluto/demux.c openswan-2.4.7/programs/pluto/demux.c
  48. --- openswan-2.4.7.orig/programs/pluto/demux.c 2005-10-06 02:57:26.000000000 +0200
  49. +++ openswan-2.4.7/programs/pluto/demux.c 2006-11-28 17:04:27.000000000 +0100
  50. @@ -1009,7 +1009,9 @@ send_packet(struct state *st, const char
  51. , len, 0
  52. , sockaddrof(&st->st_remoteaddr)
  53. , sockaddrlenof(&st->st_remoteaddr));
  54. +#ifdef DEBUG
  55. }
  56. +#endif
  57. #endif
  58. diff -urp openswan-2.4.7.orig/programs/pluto/log.c openswan-2.4.7/programs/pluto/log.c
  59. --- openswan-2.4.7.orig/programs/pluto/log.c 2005-07-18 21:40:15.000000000 +0200
  60. +++ openswan-2.4.7/programs/pluto/log.c 2006-11-28 16:56:53.000000000 +0100
  61. @@ -424,6 +424,7 @@ openswan_log(const char *message, ...)
  62. whack_log(RC_LOG, "~%s", m);
  63. }
  64. +#if !defined(NO_DEBUG)
  65. void
  66. loglog(int mess_no, const char *message, ...)
  67. {
  68. @@ -443,6 +444,7 @@ loglog(int mess_no, const char *message,
  69. whack_log(mess_no, "~%s", m);
  70. }
  71. +#endif
  72. void
  73. log_errno_routine(int e, const char *message, ...)
  74. diff -urp openswan-2.4.7.orig/programs/pluto/log.h openswan-2.4.7/programs/pluto/log.h
  75. --- openswan-2.4.7.orig/programs/pluto/log.h 2004-10-21 21:13:37.000000000 +0200
  76. +++ openswan-2.4.7/programs/pluto/log.h 2006-11-28 16:13:26.000000000 +0100
  77. @@ -151,10 +151,12 @@ extern void exit_log_errno_routine(int e
  78. extern void whack_log(int mess_no, const char *message, ...) PRINTF_LIKE(2);
  79. +#if !defined(NO_DEBUG)
  80. /* Log to both main log and whack log
  81. * Much like log, actually, except for specifying mess_no.
  82. */
  83. extern void loglog(int mess_no, const char *message, ...) PRINTF_LIKE(2);
  84. +#endif
  85. /* show status, usually on whack log */
  86. extern void show_status(void);
  87. diff -urp openswan-2.4.7.orig/programs/pluto/pluto_crypt.c openswan-2.4.7/programs/pluto/pluto_crypt.c
  88. --- openswan-2.4.7.orig/programs/pluto/pluto_crypt.c 2005-07-13 04:14:08.000000000 +0200
  89. +++ openswan-2.4.7/programs/pluto/pluto_crypt.c 2006-11-28 17:25:43.000000000 +0100
  90. @@ -658,7 +658,9 @@ static void init_crypto_helper(struct pl
  91. pluto_init_log();
  92. init_rnd_pool();
  93. free_preshared_secrets();
  94. +#if !defined(NO_DEBUG)
  95. openswan_passert_fail = helper_passert_fail;
  96. +#endif
  97. debug_prefix='!';
  98. pluto_crypto_helper(fds[1], n);
  99. diff -urp openswan-2.4.7.orig/programs/pluto/plutomain.c openswan-2.4.7/programs/pluto/plutomain.c
  100. --- openswan-2.4.7.orig/programs/pluto/plutomain.c 2006-10-27 05:00:30.000000000 +0200
  101. +++ openswan-2.4.7/programs/pluto/plutomain.c 2006-11-28 17:00:56.000000000 +0100
  102. @@ -85,9 +85,9 @@
  103. const char *ipsec_dir = IPSECDIR;
  104. const char *ctlbase = "/var/run/pluto";
  105. -
  106. +#if !defined(NO_DEBUG)
  107. openswan_passert_fail_t openswan_passert_fail = passert_fail;
  108. -
  109. +#endif
  110. /** usage - print help messages
  111. *
  112. * @param mess String - alternate message to print
  113. @@ -282,7 +282,9 @@ main(int argc, char **argv)
  114. global_argv = argv;
  115. global_argc = argc;
  116. +#if !defined(NO_DEBUG)
  117. openswan_passert_fail = passert_fail;
  118. +#endif
  119. /* see if there is an environment variable */
  120. coredir = getenv("PLUTO_CORE_DIR");
  121. @@ -564,10 +566,12 @@ main(int argc, char **argv)
  122. case '4': /* --disable_port_floating */
  123. nat_t_spf = FALSE;
  124. continue;
  125. +#ifdef DEBUG
  126. case '5': /* --debug-nat_t */
  127. base_debugging |= DBG_NATT;
  128. continue;
  129. #endif
  130. +#endif
  131. #ifdef VIRTUAL_IP
  132. case '6': /* --virtual_private */
  133. virtual_private = optarg;