rename to version specific patch
[buildroot.git] / package / openswan / openswan-2.4.9-005-pluto.patch
blob594678a7e7674d6839389a52128f9a799631cb31
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)
7 set_cur_connection(c);
9 +#ifdef DEBUG
10 /* turn on any extra debugging asked for */
11 c->extra_debugging |= moredebug;
13 +#endif
14 if (!oriented(*c))
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));
21 +#ifdef DEBUG
22 snprintf(demandbuf, 256, "initiate on demand from %s:%d to %s:%d proto=%d state: %s because: %s"
23 , ours, ourport, his, hisport, b->transport_proto
24 , oppo_step_name[b->step], b->want);
25 @@ -2588,7 +2589,7 @@ initiate_opportunistic_body(struct find_
26 whack_log(RC_COMMENT, "%s", demandbuf);
27 loggedit = TRUE;
30 +#endif
31 if (isanyaddr(&b->our_client) || isanyaddr(&b->peer_client))
33 cannot_oppo(NULL, b, "impossible IP address");
34 @@ -4465,6 +4467,7 @@ show_connections_status(void)
35 , c->dpd_delay, c->dpd_timeout);
38 +#ifdef DEBUG
39 if(c->extra_debugging) {
40 whack_log(RC_COMMENT, "\"%s\"%s: debug: %s"
41 , c->name
42 @@ -4472,6 +4475,7 @@ show_connections_status(void)
43 , bitnamesof(debug_bit_names
44 , c->extra_debugging));
46 +#endif
48 whack_log(RC_COMMENT
49 , "\"%s\"%s: newest ISAKMP SA: #%ld; newest IPsec SA: #%ld; "
50 diff -urp openswan-2.4.7.orig/programs/pluto/demux.c openswan-2.4.7/programs/pluto/demux.c
51 --- openswan-2.4.7.orig/programs/pluto/demux.c 2005-10-06 02:57:26.000000000 +0200
52 +++ openswan-2.4.7/programs/pluto/demux.c 2006-11-28 17:04:27.000000000 +0100
53 @@ -1009,7 +1009,9 @@ send_packet(struct state *st, const char
54 , len, 0
55 , sockaddrof(&st->st_remoteaddr)
56 , sockaddrlenof(&st->st_remoteaddr));
57 +#ifdef DEBUG
59 +#endif
62 #endif
63 diff -urp openswan-2.4.7.orig/programs/pluto/log.c openswan-2.4.7/programs/pluto/log.c
64 --- openswan-2.4.7.orig/programs/pluto/log.c 2005-07-18 21:40:15.000000000 +0200
65 +++ openswan-2.4.7/programs/pluto/log.c 2006-11-28 16:56:53.000000000 +0100
66 @@ -424,6 +424,7 @@ openswan_log(const char *message, ...)
67 whack_log(RC_LOG, "~%s", m);
70 +#if !defined(NO_DEBUG)
71 void
72 loglog(int mess_no, const char *message, ...)
74 @@ -443,6 +444,7 @@ loglog(int mess_no, const char *message,
76 whack_log(mess_no, "~%s", m);
78 +#endif
80 void
81 log_errno_routine(int e, const char *message, ...)
82 diff -urp openswan-2.4.7.orig/programs/pluto/log.h openswan-2.4.7/programs/pluto/log.h
83 --- openswan-2.4.7.orig/programs/pluto/log.h 2004-10-21 21:13:37.000000000 +0200
84 +++ openswan-2.4.7/programs/pluto/log.h 2006-11-28 16:13:26.000000000 +0100
85 @@ -151,10 +151,12 @@ extern void exit_log_errno_routine(int e
87 extern void whack_log(int mess_no, const char *message, ...) PRINTF_LIKE(2);
89 +#if !defined(NO_DEBUG)
90 /* Log to both main log and whack log
91 * Much like log, actually, except for specifying mess_no.
93 extern void loglog(int mess_no, const char *message, ...) PRINTF_LIKE(2);
94 +#endif
96 /* show status, usually on whack log */
97 extern void show_status(void);
98 diff -urp openswan-2.4.7.orig/programs/pluto/pluto_crypt.c openswan-2.4.7/programs/pluto/pluto_crypt.c
99 --- openswan-2.4.7.orig/programs/pluto/pluto_crypt.c 2005-07-13 04:14:08.000000000 +0200
100 +++ openswan-2.4.7/programs/pluto/pluto_crypt.c 2006-11-28 17:25:43.000000000 +0100
101 @@ -658,7 +658,9 @@ static void init_crypto_helper(struct pl
102 pluto_init_log();
103 init_rnd_pool();
104 free_preshared_secrets();
105 +#if !defined(NO_DEBUG)
106 openswan_passert_fail = helper_passert_fail;
107 +#endif
108 debug_prefix='!';
110 pluto_crypto_helper(fds[1], n);
111 diff -urp openswan-2.4.7.orig/programs/pluto/plutomain.c openswan-2.4.7/programs/pluto/plutomain.c
112 --- openswan-2.4.7.orig/programs/pluto/plutomain.c 2006-10-27 05:00:30.000000000 +0200
113 +++ openswan-2.4.7/programs/pluto/plutomain.c 2006-11-28 17:00:56.000000000 +0100
114 @@ -85,9 +85,9 @@
116 const char *ipsec_dir = IPSECDIR;
117 const char *ctlbase = "/var/run/pluto";
119 +#if !defined(NO_DEBUG)
120 openswan_passert_fail_t openswan_passert_fail = passert_fail;
122 +#endif
123 /** usage - print help messages
125 * @param mess String - alternate message to print
126 @@ -282,7 +282,9 @@ main(int argc, char **argv)
128 global_argv = argv;
129 global_argc = argc;
130 +#if !defined(NO_DEBUG)
131 openswan_passert_fail = passert_fail;
132 +#endif
134 /* see if there is an environment variable */
135 coredir = getenv("PLUTO_CORE_DIR");
136 @@ -564,10 +566,12 @@ main(int argc, char **argv)
137 case '4': /* --disable_port_floating */
138 nat_t_spf = FALSE;
139 continue;
140 +#ifdef DEBUG
141 case '5': /* --debug-nat_t */
142 base_debugging |= DBG_NATT;
143 continue;
144 #endif
145 +#endif
146 #ifdef VIRTUAL_IP
147 case '6': /* --virtual_private */
148 virtual_private = optarg;