bump version
[buildroot.git] / package / l2tp / l2tp-rename-func-log.patch
blobe0e9b58e26263016b2cb9fbc3e9f916fef86c8a8
1 diff -rdup l2tpd-0.70-pre20031121.oorig/aaa.c l2tpd-0.70-pre20031121/aaa.c
2 --- l2tpd-0.70-pre20031121.oorig/aaa.c 2006-12-28 16:30:10.000000000 +0100
3 +++ l2tpd-0.70-pre20031121/aaa.c 2006-12-28 16:41:59.000000000 +0100
4 @@ -144,7 +144,7 @@ int get_secret (char *us, char *them, ch
5 f = fopen (gconfig.authfile, "r");
6 if (!f)
8 - log (LOG_WARN, "%s : Unable to open '%s' for authentication\n",
9 + do_log (LOG_WARN, "%s : Unable to open '%s' for authentication\n",
10 __FUNCTION__, gconfig.authfile);
11 return 0;
13 @@ -168,7 +168,7 @@ int get_secret (char *us, char *them, ch
14 /* us */
15 if (!*u)
17 - log (LOG_WARN,
18 + do_log (LOG_WARN,
19 "%s: Invalid authentication info (no us), line %d\n",
20 __FUNCTION__, num);
21 continue;
22 @@ -182,7 +182,7 @@ int get_secret (char *us, char *them, ch
23 /* them */
24 if (!*t)
26 - log (LOG_WARN,
27 + do_log (LOG_WARN,
28 "%s: Invalid authentication info (nothem), line %d\n",
29 __FUNCTION__, num);
30 continue;
31 @@ -195,7 +195,7 @@ int get_secret (char *us, char *them, ch
32 s++;
33 if (!*s)
35 - log (LOG_WARN,
36 + do_log (LOG_WARN,
37 "%s: Invalid authentication info (no secret), line %d\n",
38 __FUNCTION__, num);
39 continue;
40 @@ -204,7 +204,7 @@ int get_secret (char *us, char *them, ch
41 (!strcasecmp (t, them) || !strcasecmp (t, "*")))
43 #ifdef DEBUG_AUTH
44 - log (LOG_DEBUG,
45 + do_log (LOG_DEBUG,
46 "%s: we are '%s', they are '%s', secret is '%s'\n",
47 __FUNCTION__, u, t, s);
48 #endif
49 @@ -223,12 +223,12 @@ int handle_challenge (struct tunnel *t,
50 char *them;
51 if (!t->lns && !t->lac)
53 - log (LOG_DEBUG, "%s: No LNS or LAC to handle challenge!\n",
54 + do_log (LOG_DEBUG, "%s: No LNS or LAC to handle challenge!\n",
55 __FUNCTION__);
56 return -1;
58 #ifdef DEBUG_AUTH
59 - log (LOG_DEBUG, "%s: making response for tunnel: %d\n", __FUNCTION__,
60 + do_log (LOG_DEBUG, "%s: making response for tunnel: %d\n", __FUNCTION__,
61 t->ourtid);
62 #endif
63 if (t->lns)
64 @@ -255,19 +255,19 @@ int handle_challenge (struct tunnel *t,
66 if (!get_secret (us, them, chal->secret, sizeof (chal->secret)))
68 - log (LOG_DEBUG, "%s: no secret found for us='%s' and them='%s'\n",
69 + do_log (LOG_DEBUG, "%s: no secret found for us='%s' and them='%s'\n",
70 __FUNCTION__, us, them);
71 return -1;
74 #if DEBUG_AUTH
75 - log (LOG_DEBUG, "*%s: Here comes the chal->ss:\n", __FUNCTION__);
76 + do_log (LOG_DEBUG, "*%s: Here comes the chal->ss:\n", __FUNCTION__);
77 bufferDump (&chal->ss, 1);
79 - log (LOG_DEBUG, "%s: Here comes the secret\n", __FUNCTION__);
80 + do_log (LOG_DEBUG, "%s: Here comes the secret\n", __FUNCTION__);
81 bufferDump (chal->secret, strlen (chal->secret));
83 - log (LOG_DEBUG, "%s: Here comes the challenge\n", __FUNCTION__);
84 + do_log (LOG_DEBUG, "%s: Here comes the challenge\n", __FUNCTION__);
85 bufferDump (chal->challenge, strlen (chal->challenge));
86 #endif
88 @@ -278,7 +278,7 @@ int handle_challenge (struct tunnel *t,
89 MD5Update (&chal->md5, chal->challenge, strlen(chal->challenge));
90 MD5Final (chal->response, &chal->md5);
91 #ifdef DEBUG_AUTH
92 - log (LOG_DEBUG, "response is %X%X%X%X to '%s' and %X%X%X%X, %d\n",
93 + do_log (LOG_DEBUG, "response is %X%X%X%X to '%s' and %X%X%X%X, %d\n",
94 *((int *) &chal->response[0]),
95 *((int *) &chal->response[4]),
96 *((int *) &chal->response[8]),
97 @@ -321,7 +321,7 @@ struct lns *get_lns (struct tunnel *t)
98 (ntohl (t->peer.sin_addr.s_addr) <= ntohl (ipr->end)))
100 #ifdef DEBUG_AAA
101 - log (LOG_DEBUG,
102 + do_log (LOG_DEBUG,
103 "get_lns: Rule %s to %s, sense %s matched %s\n",
104 IPADDY (ipr->start), IPADDY (ipr->end),
105 (ipr->sense ? "allow" : "deny"), IPADDY (t->addr));
106 @@ -349,14 +349,14 @@ struct lns *get_lns (struct tunnel *t)
107 void print_md5 (void *md5)
109 int *i = (int *) md5;
110 - log (LOG_DEBUG, "%X%X%X%X\n", i[0], i[1], i[2], i[3], i[4]);
111 + do_log (LOG_DEBUG, "%X%X%X%X\n", i[0], i[1], i[2], i[3], i[4]);
114 inline void print_challenge (struct challenge *chal)
116 - log (LOG_DEBUG, "vector: ");
117 + do_log (LOG_DEBUG, "vector: ");
118 print_md5 (chal->vector);
119 - log (LOG_DEBUG, "secret: %s\n", chal->secret);
120 + do_log (LOG_DEBUG, "secret: %s\n", chal->secret);
122 #endif
123 void encrypt_avp (struct buffer *buf, _u16 len, struct tunnel *t)
124 @@ -405,9 +405,9 @@ void encrypt_avp (struct buffer *buf, _u
125 while (ptr < end)
127 #if DEBUG_HIDDEN
128 - log (LOG_DEBUG, "%s: The digest to be XOR'ed\n", __FUNCTION__);
129 + do_log (LOG_DEBUG, "%s: The digest to be XOR'ed\n", __FUNCTION__);
130 bufferDump (digest, MD_SIG_SIZE);
131 - log (LOG_DEBUG, "%s: The plaintext to be XOR'ed\n", __FUNCTION__);
132 + do_log (LOG_DEBUG, "%s: The plaintext to be XOR'ed\n", __FUNCTION__);
133 bufferDump (ptr, MD_SIG_SIZE);
134 #endif
135 for (cnt = 0; cnt < MD_SIG_SIZE; cnt++, ptr++)
136 @@ -415,7 +415,7 @@ void encrypt_avp (struct buffer *buf, _u
137 *ptr = *ptr ^ digest[cnt];
139 #if DEBUG_HIDDEN
140 - log (LOG_DEBUG, "%s: The result of XOR\n", __FUNCTION__);
141 + do_log (LOG_DEBUG, "%s: The result of XOR\n", __FUNCTION__);
142 bufferDump (previous_segment, MD_SIG_SIZE);
143 #endif
144 if (ptr < end)
145 @@ -449,7 +449,7 @@ int decrypt_avp (char *buf, struct tunne
146 end = buf + olen;
147 if (!t->chal_us.vector)
149 - log (LOG_DEBUG,
150 + do_log (LOG_DEBUG,
151 "decrypt_avp: Hidden bit set, but no random vector specified!\n");
152 return -EINVAL;
154 @@ -464,9 +464,9 @@ int decrypt_avp (char *buf, struct tunne
155 MD5Update (&t->chal_us.md5, t->chal_us.vector, t->chal_us.vector_len);
156 MD5Final (digest, &t->chal_us.md5);
157 #ifdef DEBUG_HIDDEN
158 - log (LOG_DEBUG, "attribute is %d and challenge is: ", attr);
159 + do_log (LOG_DEBUG, "attribute is %d and challenge is: ", attr);
160 print_challenge (&t->chal_us);
161 - log (LOG_DEBUG, "md5 is: ");
162 + do_log (LOG_DEBUG, "md5 is: ");
163 print_md5 (digest);
164 #endif
165 while (ptr < end)
166 @@ -498,7 +498,7 @@ int decrypt_avp (char *buf, struct tunne
167 len = ntohs (new_hdr->attr) + sizeof (struct avp_hdr);
168 if (len > olen - 2)
170 - log (LOG_DEBUG,
171 + do_log (LOG_DEBUG,
172 "decrypt_avp: Decrypted length is too long (%d > %d)\n", len,
173 olen - 2);
174 return -EINVAL;
175 diff -rdup l2tpd-0.70-pre20031121.oorig/avp.c l2tpd-0.70-pre20031121/avp.c
176 --- l2tpd-0.70-pre20031121.oorig/avp.c 2006-12-28 16:30:10.000000000 +0100
177 +++ l2tpd-0.70-pre20031121/avp.c 2006-12-28 16:41:59.000000000 +0100
178 @@ -156,7 +156,7 @@ int validate_msgtype_avp(int attr, stru
179 if ((c != t->self) && (c->msgtype < Hello))
181 if (DEBUG)
182 - log (LOG_DEBUG,
183 + do_log (LOG_DEBUG,
184 "%s: attempting to negotiate tunnel inside a call!\n",
185 __func__);
186 return -EINVAL;
187 @@ -173,7 +173,7 @@ int validate_msgtype_avp(int attr, stru
190 if (DEBUG)
191 - log (LOG_DEBUG,
192 + do_log (LOG_DEBUG,
193 "%s: attempting to negotiate SCCRQ with state != 0\n",
194 __func__);
195 return -EINVAL;
196 @@ -183,7 +183,7 @@ int validate_msgtype_avp(int attr, stru
197 if (t->state != SCCRQ)
199 if (DEBUG)
200 - log (LOG_DEBUG,
201 + do_log (LOG_DEBUG,
202 "%s: attempting to negotiate SCCRP with state != SCCRQ!\n",
203 __func__);
204 return -EINVAL;
205 @@ -193,7 +193,7 @@ int validate_msgtype_avp(int attr, stru
206 if (t->state != SCCRP)
208 if (DEBUG)
209 - log (LOG_DEBUG,
210 + do_log (LOG_DEBUG,
211 "%s: attempting to negotiate SCCCN with state != SCCRP!\n",
212 __func__);
213 return -EINVAL;
214 @@ -203,7 +203,7 @@ int validate_msgtype_avp(int attr, stru
215 if (t->state != SCCCN)
217 if (DEBUG)
218 - log (LOG_DEBUG,
219 + do_log (LOG_DEBUG,
220 "%s: attempting to negotiate ICRQ when state != SCCCN\n",
221 __func__);
222 return -EINVAL;
223 @@ -211,7 +211,7 @@ int validate_msgtype_avp(int attr, stru
224 if (c != t->self)
226 if (DEBUG)
227 - log (LOG_DEBUG,
228 + do_log (LOG_DEBUG,
229 "%s: attempting to negotiate ICRQ on a call!\n",
230 __func__);
231 return -EINVAL;
232 @@ -221,7 +221,7 @@ int validate_msgtype_avp(int attr, stru
233 if (t->state != SCCCN)
235 if (DEBUG)
236 - log (LOG_DEBUG,
237 + do_log (LOG_DEBUG,
238 "%s: attempting to negotiate ICRP on tunnel!=SCCCN\n",
239 __func__);
240 return -EINVAL;
241 @@ -229,7 +229,7 @@ int validate_msgtype_avp(int attr, stru
242 if (c->state != ICRQ)
244 if (DEBUG)
245 - log (LOG_DEBUG,
246 + do_log (LOG_DEBUG,
247 "%s: attempting to negotiate ICRP when state != ICRQ\n",
248 __func__);
249 return -EINVAL;
250 @@ -239,7 +239,7 @@ int validate_msgtype_avp(int attr, stru
251 if (c->state != ICRP)
253 if (DEBUG)
254 - log (LOG_DEBUG,
255 + do_log (LOG_DEBUG,
256 "%s: attempting to negotiate ICCN when state != ICRP\n",
257 __func__);
258 return -EINVAL;
259 @@ -249,7 +249,7 @@ int validate_msgtype_avp(int attr, stru
260 if (c->state != ICCN)
262 if (DEBUG)
263 - log (LOG_DEBUG,
264 + do_log (LOG_DEBUG,
265 "%s: attempting to negotiate SLI when state != ICCN\n",
266 __func__);
267 return -EINVAL;
268 @@ -259,7 +259,7 @@ int validate_msgtype_avp(int attr, stru
269 if (t->state != SCCCN)
271 if (DEBUG)
272 - log (LOG_DEBUG,
273 + do_log (LOG_DEBUG,
274 "%s: attempting to negotiate OCRP on tunnel!=SCCCN\n",
275 __func__);
276 return -EINVAL;
277 @@ -267,7 +267,7 @@ int validate_msgtype_avp(int attr, stru
278 if (c->state != OCRQ)
280 if (DEBUG)
281 - log (LOG_DEBUG,
282 + do_log (LOG_DEBUG,
283 "%s: attempting to negotiate OCRP when state != OCRQ\n",
284 __func__);
285 return -EINVAL;
286 @@ -278,7 +278,7 @@ int validate_msgtype_avp(int attr, stru
287 if (c->state != OCRQ)
289 if (DEBUG)
290 - log (LOG_DEBUG,
291 + do_log (LOG_DEBUG,
292 "%s: attempting to negotiate OCCN when state != OCRQ\n",
293 __func__);
294 return -EINVAL;
295 @@ -289,7 +289,7 @@ int validate_msgtype_avp(int attr, stru
296 case Hello:
297 break;
298 default:
299 - log (LOG_WARN, "%s: unknown messages type %d\n",
300 + do_log (LOG_WARN, "%s: unknown messages type %d\n",
301 __func__, get16(p));
302 return -EINVAL;
304 @@ -332,7 +332,7 @@ int ignore_avp (struct tunnel *t, struct
307 if (debug_avp)
308 - log (LOG_DEBUG, "%s : Ignoring AVP\n", __func__);
309 + do_log (LOG_DEBUG, "%s : Ignoring AVP\n", __func__);
310 return 0;
313 @@ -347,22 +347,22 @@ int message_type_avp (struct tunnel *t,
315 if ((c->msgtype > MAX_MSG) || (!msgtypes[c->msgtype]))
317 - log (LOG_DEBUG, "%s: unknown message type %d\n", __func__,
318 + do_log (LOG_DEBUG, "%s: unknown message type %d\n", __func__,
319 c->msgtype);
320 return -EINVAL;
322 if (debug_avp)
323 - log (LOG_DEBUG, "%s: message type %d (%s)\n", __func__,
324 + do_log (LOG_DEBUG, "%s: message type %d (%s)\n", __func__,
325 c->msgtype, msgtypes[c->msgtype]);
326 if (c->msgtype == ICRQ)
328 struct call *tmp;
329 if (debug_avp)
330 - log (LOG_DEBUG, "%s: new incoming call\n", __func__);
331 + do_log (LOG_DEBUG, "%s: new incoming call\n", __func__);
332 tmp = new_call (t);
333 if (!tmp)
335 - log (LOG_WARN, "%s: unable to create new call\n", __func__);
336 + do_log (LOG_WARN, "%s: unable to create new call\n", __func__);
337 return -EINVAL;
339 tmp->next = t->call_head;
340 @@ -384,7 +384,7 @@ int rand_vector_avp (struct tunnel *t, s
341 u_int8_t *p = data + sizeof(struct avp_hdr);
342 int datalen = avplen - sizeof(struct avp_hdr);
343 if (debug_avp)
344 - log (LOG_DEBUG, "%s: random vector len %d\n", __func__, datalen);
345 + do_log (LOG_DEBUG, "%s: random vector len %d\n", __func__, datalen);
346 t->chal_us.vector = (unsigned char *)p;
347 t->chal_us.vector_len = datalen;
348 return 0;
349 @@ -394,7 +394,7 @@ int rand_vector_avp (struct tunnel *t, s
350 int seq_reqd_avp (struct tunnel *t, struct call *c, void *data, int datalen)
352 if (debug_avp)
353 - log (LOG_DEBUG, "%s: peer requires sequencing.\n", __func__);
354 + do_log (LOG_DEBUG, "%s: peer requires sequencing.\n", __func__);
355 c->seq_reqd = -1;
356 return 0;
358 @@ -411,7 +411,7 @@ int result_code_avp (struct tunnel *t, s
359 if ((c->msgtype == StopCCN) && ((result > 7) || (result < 1)))
361 if (DEBUG)
362 - log (LOG_DEBUG,
363 + do_log (LOG_DEBUG,
364 "%s: (StopCCN) result code out of range ! (1 < %d < 7)\n",
365 __func__, result);
366 return 0;
367 @@ -420,7 +420,7 @@ int result_code_avp (struct tunnel *t, s
368 if ((c->msgtype == CDN) && ((result > 11) || (result < 1)))
370 if (DEBUG)
371 - log (LOG_DEBUG,
372 + do_log (LOG_DEBUG,
373 "%s: (CDN) result code out of range !(1 < %d < 11)\n",
374 __func__, result);
375 return 0;
376 @@ -435,14 +435,14 @@ int result_code_avp (struct tunnel *t, s
378 if(c->msgtype == StopCCN)
380 - log (LOG_DEBUG,
381 + do_log (LOG_DEBUG,
382 "%s: peer closing for reason %d (%s), error = %d (%s)\n",
383 __func__, result, stopccn_result_codes[result], error,
384 c->errormsg);
386 else
388 - log (LOG_DEBUG,
389 + do_log (LOG_DEBUG,
390 "%s: peer closing for reason %d (%s), error = %d (%s)\n",
391 __func__, result, cdn_result_codes[result], error,
392 c->errormsg);
393 @@ -458,7 +458,7 @@ int protocol_version_avp (struct tunnel
394 u_int8_t *p = data + sizeof(struct avp_hdr);
396 if (debug_avp)
397 - log (LOG_DEBUG, "%s: peer is using version %d, revision %d.\n",
398 + do_log (LOG_DEBUG, "%s: peer is using version %d, revision %d.\n",
399 __func__,*p, *(p+1));
400 return 0;
402 @@ -471,7 +471,7 @@ int framing_caps_avp (struct tunnel *t,
403 u_int16_t caps = get16(p + 2);
405 if (debug_avp)
406 - log (LOG_DEBUG, "%s: supported peer frames:%s %s\n", __func__,
407 + do_log (LOG_DEBUG, "%s: supported peer frames:%s %s\n", __func__,
408 caps & ASYNC_FRAMING ? "async" : "",
409 caps & SYNC_FRAMING ? "sync" : "");
411 @@ -487,7 +487,7 @@ int bearer_caps_avp (struct tunnel *t, s
412 u_int16_t caps = get16(p + 2);
414 if (debug_avp)
415 - log (LOG_DEBUG, "%s: supported peer bearers:%s %s\n",
416 + do_log (LOG_DEBUG, "%s: supported peer bearers:%s %s\n",
417 __func__,
418 caps & ANALOG_BEARER ? "analog" : "",
419 caps & DIGITAL_BEARER ? "digital" : "");
420 @@ -504,7 +504,7 @@ int firmware_rev_avp (struct tunnel *t,
422 t->firmware = get16(p);
423 if (debug_avp)
424 - log (LOG_DEBUG, "%s: peer reports firmware version %d (0x%.4X)\n",
425 + do_log (LOG_DEBUG, "%s: peer reports firmware version %d (0x%.4X)\n",
426 __func__, t->firmware, t->firmware);
427 return 0;
429 @@ -517,7 +517,7 @@ int bearer_type_avp (struct tunnel *t, s
431 t->call_head->bearer = get16(p + 2);
432 if (debug_avp)
433 - log (LOG_DEBUG, "%s: peer bears: %s\n", __func__,
434 + do_log (LOG_DEBUG, "%s: peer bears: %s\n", __func__,
435 (t->call_head->bearer & ANALOG_BEARER) ? "analog" : "digital");
436 return 0;
438 @@ -529,7 +529,7 @@ int frame_type_avp (struct tunnel *t, st
440 c->frame = get16(p + 2);
441 if (debug_avp)
442 - log (LOG_DEBUG, "%s: peer uses:%s frames\n", __func__,
443 + do_log (LOG_DEBUG, "%s: peer uses:%s frames\n", __func__,
444 (c->frame & ASYNC_FRAMING) ? "async" : "sync");
445 return 0;
447 @@ -544,7 +544,7 @@ int hostname_avp (struct tunnel *t, stru
448 t->hostname[datalen] = '\0';
450 if (debug_avp)
451 - log (LOG_DEBUG, "%s: peer reports hostname '%s'\n", __func__,
452 + do_log (LOG_DEBUG, "%s: peer reports hostname '%s'\n", __func__,
453 t->hostname);
455 return 0;
456 @@ -561,7 +561,7 @@ int calling_number_avp (struct tunnel *t
457 t->call_head->dialing[datalen] = '\0';
459 if (debug_avp)
460 - log (LOG_DEBUG, "%s: peer reports dialing number '%s'\n", __func__,
461 + do_log (LOG_DEBUG, "%s: peer reports dialing number '%s'\n", __func__,
462 t->call_head->dialing);
464 return 0;
465 @@ -578,7 +578,7 @@ int called_number_avp (struct tunnel *t,
466 t->call_head->dialed[datalen] = '\0';
468 if (debug_avp)
469 - log (LOG_DEBUG, "%s: peer reports dialed number '%s'\n", __func__,
470 + do_log (LOG_DEBUG, "%s: peer reports dialed number '%s'\n", __func__,
471 t->call_head->dialed);
473 return 0;
474 @@ -595,7 +595,7 @@ int sub_address_avp (struct tunnel *t, s
475 t->call_head->subaddy[datalen] = '\0';
477 if (debug_avp)
478 - log (LOG_DEBUG, "%s: peer reports subaddress '%s'\n", __func__,
479 + do_log (LOG_DEBUG, "%s: peer reports subaddress '%s'\n", __func__,
480 t->call_head->subaddy);
481 return 0;
483 @@ -610,7 +610,7 @@ int vendor_avp (struct tunnel *t, struct
484 t->vendor[datalen] = '\0';
486 if (debug_avp)
487 - log (LOG_DEBUG, "%s: peer reports vendor '%s'\n", __func__, t->vendor);
488 + do_log (LOG_DEBUG, "%s: peer reports vendor '%s'\n", __func__, t->vendor);
489 return 0;
492 @@ -627,7 +627,7 @@ int challenge_avp (struct tunnel *t, str
493 t->chal_us.state = STATE_CHALLENGED;
495 if (debug_avp)
496 - log (LOG_DEBUG, "%s: challenge avp found\n", __func__);
497 + do_log (LOG_DEBUG, "%s: challenge avp found\n", __func__);
499 return 0;
501 @@ -639,7 +639,7 @@ int chalresp_avp (struct tunnel *t, stru
503 memcpy(t->chal_them.reply, p, MD_SIG_SIZE);
504 if(debug_avp)
505 - log(LOG_DEBUG, "%s: Challenge reply found\n", __func__);
506 + do_log(LOG_DEBUG, "%s: Challenge reply found\n", __func__);
507 return 0;
510 @@ -655,7 +655,7 @@ int assigned_tunnel_avp (struct tunnel *
511 else
512 t->tid = id;
513 if (debug_avp)
514 - log (LOG_DEBUG, "%s: using peer's tunnel %d\n", __func__, id);
515 + do_log (LOG_DEBUG, "%s: using peer's tunnel %d\n", __func__, id);
516 return 0;
519 @@ -678,7 +678,7 @@ int assigned_session_avp (struct tunnel
522 if (debug_avp)
523 - log (LOG_DEBUG, "%s: assigned session id: %d\n", __func__, id);
524 + do_log (LOG_DEBUG, "%s: assigned session id: %d\n", __func__, id);
525 return 0;
528 @@ -690,7 +690,7 @@ int packet_delay_avp (struct tunnel *t,
530 c->ppd = get16(p);
531 if (debug_avp)
532 - log (LOG_DEBUG, "%s: peer's delay is %d 1/10's of a second\n", __func__,
533 + do_log (LOG_DEBUG, "%s: peer's delay is %d 1/10's of a second\n", __func__,
534 c->ppd);
535 return 0;
537 @@ -705,7 +705,7 @@ int call_serno_avp (struct tunnel *t, st
539 t->call_head->serno = get32(p);
540 if (debug_avp)
541 - log (LOG_DEBUG, "%s: serial number is %d\n", __func__,
542 + do_log (LOG_DEBUG, "%s: serial number is %d\n", __func__,
543 t->call_head->serno);
544 return 0;
546 @@ -717,7 +717,7 @@ int rx_speed_avp (struct tunnel *t, stru
548 c->rxspeed = get32(p);
549 if(debug_avp)
550 - log(LOG_DEBUG, "%s: receive baud rate is %d\n", __func__, c->rxspeed);
551 + do_log(LOG_DEBUG, "%s: receive baud rate is %d\n", __func__, c->rxspeed);
552 return 0;
555 @@ -728,7 +728,7 @@ int tx_speed_avp (struct tunnel *t, stru
557 c->txspeed = get32(p);
558 if (debug_avp)
559 - log (LOG_DEBUG, "%s: transmit baud rate is %d\n",
560 + do_log (LOG_DEBUG, "%s: transmit baud rate is %d\n",
561 __func__, c->txspeed);
562 return 0;
564 @@ -741,7 +741,7 @@ int call_physchan_avp (struct tunnel *t,
566 t->call_head->physchan = get32(p);
567 if (debug_avp)
568 - log(LOG_DEBUG, "%s: physical channel is %d\n", __func__,
569 + do_log(LOG_DEBUG, "%s: physical channel is %d\n", __func__,
570 t->call_head->physchan);
571 return 0;
573 @@ -756,7 +756,7 @@ int receive_window_size_avp (struct tunn
574 /* if (c->rws >= 0)
575 c->fbit = FBIT; */
576 if (debug_avp)
577 - log (LOG_DEBUG, "%s: peer wants RWS of %d. Will use flow control.\n",
578 + do_log (LOG_DEBUG, "%s: peer wants RWS of %d. Will use flow control.\n",
579 __func__, t->rws);
580 return 0;
582 @@ -781,11 +781,11 @@ int handle_avps (struct buffer *buf, str
583 avp = (struct avp_hdr *) data;
585 if (debug_avp)
586 - log (LOG_DEBUG, "%s: handling avp's for tunnel %d, call %d\n",
587 + do_log (LOG_DEBUG, "%s: handling avp's for tunnel %d, call %d\n",
588 __func__, t->ourtid, c->ourcid);
590 if(len < 6) {
591 - log (LOG_WARN, "%s: packet too small\n", __func__);
592 + do_log (LOG_WARN, "%s: packet too small\n", __func__);
593 set_error(c, ERROR_LENGTH, "Invalid message length");
594 return -EINVAL;
596 @@ -800,7 +800,7 @@ int handle_avps (struct buffer *buf, str
598 if (AMBIT(rlen))
600 - log (LOG_WARN,
601 + do_log (LOG_WARN,
602 "%s: unhandeled mandatory attribute %d. Closing %s.\n",
603 __func__, attr, (c != t->self) ? "call" : "tunnel");
604 set_error (c, VENDOR_ERROR,
605 @@ -810,7 +810,7 @@ int handle_avps (struct buffer *buf, str
606 else
608 if (DEBUG)
609 - log (LOG_WARN,
610 + do_log (LOG_WARN,
611 "%s: handeled attribute %d.\n",
612 __func__, attr);
613 goto next;
614 @@ -818,7 +818,7 @@ int handle_avps (struct buffer *buf, str
616 if (ALENGTH (rlen) > len)
618 - log (LOG_WARN,
619 + do_log (LOG_WARN,
620 "%s: AVP reported length > remaining packet length\n",
621 __func__);
622 set_error (c, ERROR_LENGTH, "Invalid AVP length");
623 @@ -826,7 +826,7 @@ int handle_avps (struct buffer *buf, str
625 if (ALENGTH (rlen) < sizeof (struct avp_hdr))
627 - log (LOG_WARN, "%s: AVP reported length too small (%d).\n",
628 + do_log (LOG_WARN, "%s: AVP reported length too small (%d).\n",
629 __func__, ALENGTH (rlen));
630 set_error (c, ERROR_LENGTH, "AVP too small");
631 return -EINVAL;
632 @@ -835,7 +835,7 @@ int handle_avps (struct buffer *buf, str
633 if((avps[attr].flags & AVP_F_FIXLEN) ?
634 (ALENGTH(rlen) - sizeof(struct avp_hdr)) != avps[attr].sz :
635 (ALENGTH(rlen) - sizeof(struct avp_hdr)) > avps[attr].sz) {
636 - log (LOG_DEBUG, "%s: %s avp size mismatch (%d %s %d)\n",
637 + do_log (LOG_DEBUG, "%s: %s avp size mismatch (%d %s %d)\n",
638 __func__,
639 avps[attr].description,
640 (avps[attr].flags & AVP_F_FIXLEN) ? "!=" : "<",
641 @@ -846,14 +846,14 @@ int handle_avps (struct buffer *buf, str
643 if (attr && firstavp)
645 - log (LOG_WARN, "%s: First AVP was not message type.\n",
646 + do_log (LOG_WARN, "%s: First AVP was not message type.\n",
647 __func__);
648 set_error (c, VENDOR_ERROR, "First AVP must be message type");
649 return -EINVAL;
651 if (AZBITS (rlen))
653 - log (LOG_WARN, "%s: %sAVP has reserved bits set.\n", __func__,
654 + do_log (LOG_WARN, "%s: %sAVP has reserved bits set.\n", __func__,
655 AMBIT (rlen) ? "Mandatory " : "");
656 if (AMBIT (rlen))
658 @@ -866,7 +866,7 @@ int handle_avps (struct buffer *buf, str
659 /* decryption */
660 if (AHBIT (rlen))
662 - log (LOG_DEBUG, "%s: Hidden bit set on AVP.\n", __func__);
663 + do_log (LOG_DEBUG, "%s: Hidden bit set on AVP.\n", __func__);
664 /* We want to rewrite the AVP as an unhidden AVP
665 and then pass it along as normal. Remeber how
666 long the AVP was in the first place though! */
667 @@ -874,7 +874,7 @@ int handle_avps (struct buffer *buf, str
668 if (decrypt_avp (data, t))
670 if (debug_avp)
671 - log (LOG_WARN, "%s: Unable to handle hidden %sAVP\n:",
672 + do_log (LOG_WARN, "%s: Unable to handle hidden %sAVP\n:",
673 __func__,
674 (AMBIT (rlen) ? "mandatory " : ""));
675 if (AMBIT (rlen))
676 @@ -899,7 +899,7 @@ int handle_avps (struct buffer *buf, str
677 if(avps[attr].validate(attr, t, c, avp, ALENGTH (rlen))) {
678 if (AMBIT (rlen))
680 - log (LOG_WARN,
681 + do_log (LOG_WARN,
682 "%s: verification of AVP %d (%s) failed.\n",
683 __func__, attr,
684 avps[attr].description);
685 @@ -909,7 +909,7 @@ int handle_avps (struct buffer *buf, str
686 else
688 if (DEBUG)
689 - log (LOG_DEBUG,
690 + do_log (LOG_DEBUG,
691 "%s: Bad exit status handling attribute %d (%s).\n",
692 __func__, attr,
693 avps[attr].description);
694 @@ -924,7 +924,7 @@ int handle_avps (struct buffer *buf, str
696 if (AMBIT (rlen))
698 - log (LOG_WARN,
699 + do_log (LOG_WARN,
700 "%s: Bad exit status handling mandatory attribute %d (%s).\n",
701 __func__, attr,
702 avps[attr].description);
703 @@ -934,7 +934,7 @@ int handle_avps (struct buffer *buf, str
704 else
706 if (DEBUG)
707 - log (LOG_DEBUG,
708 + do_log (LOG_DEBUG,
709 "%s: Bad exit status handling attribute %d (%s).\n",
710 __func__, attr,
711 avps[attr].description);
712 @@ -945,7 +945,7 @@ int handle_avps (struct buffer *buf, str
714 if (AMBIT (rlen))
716 - log (LOG_WARN,
717 + do_log (LOG_WARN,
718 "%s: No handler for mandatory attribute %d (%s). Closing %s.\n",
719 __func__, attr,
720 avps[attr].description,
721 @@ -958,7 +958,7 @@ int handle_avps (struct buffer *buf, str
722 else
724 if (DEBUG)
725 - log (LOG_WARN, "%s: no handler for atribute %d (%s).\n",
726 + do_log (LOG_WARN, "%s: no handler for atribute %d (%s).\n",
727 __func__, attr,
728 avps[attr].description);
730 @@ -980,7 +980,7 @@ int handle_avps (struct buffer *buf, str
732 if (len != 0)
734 - log (LOG_WARN, "%s: negative overall packet length\n", __func__);
735 + do_log (LOG_WARN, "%s: negative overall packet length\n", __func__);
736 return -EINVAL;
739 diff -rdup l2tpd-0.70-pre20031121.oorig/avpsend.c l2tpd-0.70-pre20031121/avpsend.c
740 --- l2tpd-0.70-pre20031121.oorig/avpsend.c 2006-12-28 16:30:10.000000000 +0100
741 +++ l2tpd-0.70-pre20031121/avpsend.c 2006-12-28 16:41:59.000000000 +0100
742 @@ -29,7 +29,7 @@ static int add_avp(struct buffer *buf, u
743 u_int8_t *p = buf->start + buf->len;
745 if(avpid > AVP_MAX || !avps[avpid].flags) {
746 - log(LOG_DEBUG, "%s: invalid avp id %d\n", __func__, avpid);
747 + do_log(LOG_DEBUG, "%s: invalid avp id %d\n", __func__, avpid);
748 return 1;
751 diff -rdup l2tpd-0.70-pre20031121.oorig/call.c l2tpd-0.70-pre20031121/call.c
752 --- l2tpd-0.70-pre20031121.oorig/call.c 2004-07-08 22:47:52.000000000 +0200
753 +++ l2tpd-0.70-pre20031121/call.c 2006-12-28 16:41:59.000000000 +0100
754 @@ -138,11 +138,11 @@ int read_packet (struct buffer *buf, int
755 return 0;
757 errors++;
758 - log (LOG_DEBUG, "%s: Error %d (%s)\n", __FUNCTION__, errno,
759 + do_log (LOG_DEBUG, "%s: Error %d (%s)\n", __FUNCTION__, errno,
760 strerror (errno));
761 if (errors > 10)
763 - log (LOG_DEBUG,
764 + do_log (LOG_DEBUG,
765 "%s: Too many errors. Declaring call dead.\n",
766 __FUNCTION__);
767 return -errno;
768 @@ -154,7 +154,7 @@ int read_packet (struct buffer *buf, int
769 case PPP_FLAG:
770 if (escape)
772 - log (LOG_DEBUG, "%s: got an escaped PPP_FLAG\n",
773 + do_log (LOG_DEBUG, "%s: got an escaped PPP_FLAG\n",
774 __FUNCTION__);
775 return -EINVAL;
777 @@ -190,12 +190,12 @@ int read_packet (struct buffer *buf, int
778 buf->len++;
779 break;
781 - log (LOG_WARN, "%s: read overrun\n", __FUNCTION__);
782 + do_log (LOG_WARN, "%s: read overrun\n", __FUNCTION__);
783 return -EINVAL;
786 /* I should never get here */
787 - log (LOG_WARN, "%s: You should not see this message. If you do, please " \
788 + do_log (LOG_WARN, "%s: You should not see this message. If you do, please " \
789 "enter a bug report at http://www.l2tpd.org", __FUNCTION__);
790 return -EINVAL;
792 @@ -207,7 +207,7 @@ void call_close (struct call *c)
793 struct call *tmp, *tmp2;
794 if (!c || !c->container)
796 - log (LOG_DEBUG, "%s: called on null call or containerless call\n",
797 + do_log (LOG_DEBUG, "%s: called on null call or containerless call\n",
798 __FUNCTION__);
799 return;
801 @@ -231,7 +231,7 @@ void call_close (struct call *c)
802 || ((struct tunnel *) se->data == c->container))
804 #ifdef DEBUG_CLOSE
805 - log (LOG_DEBUG, "%s: Descheduling event\n", __FUNCTION__);
806 + do_log (LOG_DEBUG, "%s: Descheduling event\n", __FUNCTION__);
807 #endif
808 if (ose)
810 @@ -262,7 +262,7 @@ void call_close (struct call *c)
811 /* Really close this tunnel, as our
812 StopCCN has been ack'd */
813 #ifdef DEBUG_CLOSE
814 - log (LOG_DEBUG, "%s: Actually closing tunnel %d\n", __FUNCTION__,
815 + do_log (LOG_DEBUG, "%s: Actually closing tunnel %d\n", __FUNCTION__,
816 c->container->ourtid);
817 #endif
818 #ifdef USE_KERNEL
819 @@ -298,7 +298,7 @@ void call_close (struct call *c)
820 if (packet_dump)
821 do_packet_dump (buf);
822 #ifdef DEBUG_CLOSE
823 - log (LOG_DEBUG, "%s: enqueing close message for tunnel\n",
824 + do_log (LOG_DEBUG, "%s: enqueing close message for tunnel\n",
825 __FUNCTION__);
826 #endif
827 control_xmit (buf);
828 @@ -315,7 +315,7 @@ void call_close (struct call *c)
829 call_close (tmp);
830 tmp = tmp2;
832 - log (LOG_LOG,
833 + do_log (LOG_LOG,
834 "%s : Connection %d closed to %s, port %d (%s)\n", __FUNCTION__,
835 c->container->tid,
836 IPADDY (c->container->peer.sin_addr),
837 @@ -335,7 +335,7 @@ void call_close (struct call *c)
838 if (c->closing)
840 #ifdef DEBUG_CLOSE
841 - log (LOG_DEBUG, "%s: Actually closing call %d\n", __FUNCTION__,
842 + do_log (LOG_DEBUG, "%s: Actually closing call %d\n", __FUNCTION__,
843 c->ourcid);
844 #endif
845 destroy_call (c);
846 @@ -375,11 +375,11 @@ void call_close (struct call *c)
847 if (packet_dump)
848 do_packet_dump (buf);
849 #ifdef DEBUG_CLOSE
850 - log (LOG_DEBUG, "%s: enqueuing close message for call %d\n",
851 + do_log (LOG_DEBUG, "%s: enqueuing close message for call %d\n",
852 __FUNCTION__, c->ourcid);
853 #endif
854 control_xmit (buf);
855 - log (LOG_LOG, "%s: Call %d to %s disconnected\n", __FUNCTION__,
856 + do_log (LOG_LOG, "%s: Call %d to %s disconnected\n", __FUNCTION__,
857 c->ourcid, IPADDY (c->container->peer.sin_addr));
860 @@ -463,7 +463,7 @@ void destroy_call (struct call *c)
861 c->lac->active)
863 #ifdef DEBUG_MAGIC
864 - log (LOG_LOG, "%s: Will redial in %d seconds\n", __FUNCTION__,
865 + do_log (LOG_LOG, "%s: Will redial in %d seconds\n", __FUNCTION__,
866 c->lac->rtimeout);
867 #endif
868 tv.tv_sec = c->lac->rtimeout;
869 @@ -519,7 +519,7 @@ struct call *new_call (struct tunnel *pa
870 temp = (int *)entropy_buf;
871 tmp->ourcid = *temp & 0xFFFF;
872 #ifdef DEBUG_ENTROPY
873 - log(LOG_DEBUG, "ourcid = %u, entropy_buf = %hx\n", tmp->ourcid, *temp);
874 + do_log(LOG_DEBUG, "ourcid = %u, entropy_buf = %hx\n", tmp->ourcid, *temp);
875 #endif
877 #else
878 @@ -608,7 +608,7 @@ struct call *get_call (int tunnel, int c
879 return sc;
880 sc = sc->next;
882 - log (LOG_DEBUG, "%s: can't find call %d in tunnel %d\n",
883 + do_log (LOG_DEBUG, "%s: can't find call %d in tunnel %d\n",
884 __FUNCTION__, call, tunnel);
885 return NULL;
887 @@ -619,7 +619,7 @@ struct call *get_call (int tunnel, int c
889 st = st->next;
891 - log (LOG_DEBUG, "%s:can't find tunnel %d\n", __FUNCTION__, tunnel);
892 + do_log (LOG_DEBUG, "%s:can't find tunnel %d\n", __FUNCTION__, tunnel);
893 return NULL;
895 else
896 @@ -632,7 +632,7 @@ struct call *get_call (int tunnel, int c
898 if (call)
900 - log (LOG_WARN,
901 + do_log (LOG_WARN,
902 "%s: call ID specified, but no tunnel ID specified. tossing.\n",
903 __FUNCTION__);
904 return NULL;
905 @@ -643,13 +643,13 @@ struct call *get_call (int tunnel, int c
907 if (debug_tunnel)
909 - log (LOG_DEBUG,
910 + do_log (LOG_DEBUG,
911 "%s: allocating new tunnel for host %s, port %d.\n",
912 __FUNCTION__, IPADDY (addr), ntohs (port));
914 if (!(st = new_tunnel ()))
916 - log (LOG_WARN,
917 + do_log (LOG_WARN,
918 "%s: unable to allocate new tunnel for host %s, port %d.\n",
919 __FUNCTION__, IPADDY (addr), ntohs (port));
920 return NULL;
921 diff -rdup l2tpd-0.70-pre20031121.oorig/control.c l2tpd-0.70-pre20031121/control.c
922 --- l2tpd-0.70-pre20031121.oorig/control.c 2006-12-28 16:30:10.000000000 +0100
923 +++ l2tpd-0.70-pre20031121/control.c 2006-12-28 16:41:59.000000000 +0100
924 @@ -138,14 +138,14 @@ void hello (void *tun)
925 if (packet_dump)
926 do_packet_dump (buf);
927 #ifdef DEBUG_HELLO
928 - log (LOG_DEBUG, "%s: sending Hello on %d\n", __FUNCTION__, t->ourtid);
929 + do_log (LOG_DEBUG, "%s: sending Hello on %d\n", __FUNCTION__, t->ourtid);
930 #endif
931 control_xmit (buf);
933 * Schedule another Hello in a little bit.
935 #ifdef DEBUG_HELLO
936 - log (LOG_DEBUG, "%s: scheduling another Hello on %d\n", __FUNCTION__,
937 + do_log (LOG_DEBUG, "%s: scheduling another Hello on %d\n", __FUNCTION__,
938 t->ourtid);
939 #endif
940 t->hello = schedule (tv, hello, (void *) t);
941 @@ -157,7 +157,7 @@ void control_zlb (struct buffer *buf, st
942 add_control_hdr (t, c, buf);
943 t->control_seq_num--;
944 #ifdef DEBUG_ZLB
945 - log (LOG_DEBUG, "%s: sending control ZLB on tunnel %d\n", __FUNCTION__,
946 + do_log (LOG_DEBUG, "%s: sending control ZLB on tunnel %d\n", __FUNCTION__,
947 t->tid);
948 #endif
949 udp_xmit (buf);
950 @@ -187,12 +187,12 @@ int control_finish (struct tunnel *t, st
951 char dummy_buf[128] = "/var/l2tp/"; /* jz: needed to read /etc/ppp/var.options - just kick it if you dont like */
952 if (c->msgtype < 0)
954 - log (LOG_DEBUG, "%s: Whoa... non-ZLB with no message type!\n",
955 + do_log (LOG_DEBUG, "%s: Whoa... non-ZLB with no message type!\n",
956 __FUNCTION__);
957 return -EINVAL;
959 if (debug_state)
960 - log (LOG_DEBUG,
961 + do_log (LOG_DEBUG,
962 "%s: message type is %s(%d). Tunnel is %d, call is %d.\n",
963 __FUNCTION__, msgtypes[c->msgtype], c->msgtype, t->tid, c->cid);
964 switch (c->msgtype)
965 @@ -247,7 +247,7 @@ int control_finish (struct tunnel *t, st
966 if (packet_dump)
967 do_packet_dump (buf);
968 if (debug_state)
969 - log (LOG_DEBUG, "%s: control_finish: sending SCCRQ\n",
970 + do_log (LOG_DEBUG, "%s: control_finish: sending SCCRQ\n",
971 __FUNCTION__);
972 control_xmit (buf);
974 @@ -289,7 +289,7 @@ int control_finish (struct tunnel *t, st
975 if (packet_dump)
976 do_packet_dump (buf);
977 if (debug_state)
978 - log (LOG_DEBUG, "%s: sending ICRQ\n", __FUNCTION__);
979 + do_log (LOG_DEBUG, "%s: sending ICRQ\n", __FUNCTION__);
980 control_xmit (buf);
982 else
983 @@ -342,7 +342,7 @@ int control_finish (struct tunnel *t, st
984 if (t->tid <= 0)
986 if (DEBUG)
987 - log (LOG_DEBUG,
988 + do_log (LOG_DEBUG,
989 "%s: Peer did not specify assigned tunnel ID. Closing.\n",
990 __FUNCTION__);
991 set_error (c, VENDOR_ERROR, "Specify your assigned tunnel ID");
992 @@ -351,7 +351,7 @@ int control_finish (struct tunnel *t, st
993 if (!(t->lns = get_lns (t)))
995 if (DEBUG)
996 - log (LOG_DEBUG,
997 + do_log (LOG_DEBUG,
998 "%s: Denied connection to unauthorized peer %s\n",
999 __FUNCTION__, IPADDY (t->peer.sin_addr));
1000 set_error (c, VENDOR_ERROR, "No Authorization");
1001 @@ -362,7 +362,7 @@ int control_finish (struct tunnel *t, st
1002 if (t->fc < 0)
1004 if (DEBUG)
1005 - log (LOG_DEBUG,
1006 + do_log (LOG_DEBUG,
1007 "%s: Peer did not specify framing capability. Closing.\n",
1008 __FUNCTION__);
1009 set_error (c, VENDOR_ERROR, "Specify framing capability");
1010 @@ -374,7 +374,7 @@ int control_finish (struct tunnel *t, st
1011 * We shouldn't be requiring a bearer capabilities avp to be present in
1012 * SCCRQ and SCCRP as they aren't required
1013 if (t->bc < 0 ) {
1014 - if (DEBUG) log(LOG_DEBUG,
1015 + if (DEBUG) do_log(LOG_DEBUG,
1016 "%s: Peer did not specify bearer capability. Closing.\n",__FUNCTION__);
1017 set_error(c, VENDOR_ERROR, "Specify bearer capability");
1018 return -EINVAL;
1019 @@ -382,7 +382,7 @@ int control_finish (struct tunnel *t, st
1020 if ((!strlen (t->hostname)) && ((t->chal_us.state) || ((t->lns->challenge))))
1022 if (DEBUG)
1023 - log (LOG_DEBUG,
1024 + do_log (LOG_DEBUG,
1025 "%s: Peer did not specify hostname. Closing.\n",
1026 __FUNCTION__);
1027 set_error (c, VENDOR_ERROR, "Specify your hostname");
1028 @@ -401,7 +401,7 @@ int control_finish (struct tunnel *t, st
1029 * But it is legitimate for two different remote systems
1030 * to use the same tid
1032 - log (LOG_DEBUG,
1033 + do_log (LOG_DEBUG,
1034 "%s: Peer requested tunnel %d twice, ignoring second one.\n",
1035 __FUNCTION__, t->tid);
1036 c->needclose = 0;
1037 @@ -438,7 +438,7 @@ int control_finish (struct tunnel *t, st
1038 t->chal_them.challenge = malloc(MD_SIG_SIZE);
1039 if (!(t->chal_them.challenge))
1041 - log (LOG_WARN, "%s: malloc failed\n", __FUNCTION__);
1042 + do_log (LOG_WARN, "%s: malloc failed\n", __FUNCTION__);
1043 set_error (c, VENDOR_ERROR, "malloc failed");
1044 toss (buf);
1045 return -EINVAL;
1046 @@ -448,7 +448,7 @@ int control_finish (struct tunnel *t, st
1047 if (handle_challenge (t, &t->chal_them))
1049 /* We already know what to expect back */
1050 - log (LOG_WARN, "%s: No secret for '%s'\n", __FUNCTION__,
1051 + do_log (LOG_WARN, "%s: No secret for '%s'\n", __FUNCTION__,
1052 t->hostname);
1053 set_error (c, VENDOR_ERROR, "No secret on our side");
1054 toss (buf);
1055 @@ -461,7 +461,7 @@ int control_finish (struct tunnel *t, st
1056 do_packet_dump (buf);
1057 c->cnu = 0;
1058 if (debug_state)
1059 - log (LOG_DEBUG, "%s: sending SCCRP\n", __FUNCTION__);
1060 + do_log (LOG_DEBUG, "%s: sending SCCRP\n", __FUNCTION__);
1061 control_xmit (buf);
1062 break;
1063 case SCCRP:
1064 @@ -472,7 +472,7 @@ int control_finish (struct tunnel *t, st
1065 if (t->fc < 0)
1067 if (DEBUG)
1068 - log (LOG_DEBUG,
1069 + do_log (LOG_DEBUG,
1070 "%s: Peer did not specify framing capability. Closing.\n",
1071 __FUNCTION__);
1072 set_error (c, VENDOR_ERROR, "Specify framing capability");
1073 @@ -484,7 +484,7 @@ int control_finish (struct tunnel *t, st
1074 * We shouldn't be requiring a bearer capabilities avp to be present in
1075 * SCCRQ and SCCRP as they aren't required
1076 if (t->bc < 0 ) {
1077 - if (DEBUG) log(LOG_DEBUG,
1078 + if (DEBUG) do_log(LOG_DEBUG,
1079 "%s: Peer did not specify bearer capability. Closing.\n",__FUNCTION__);
1080 set_error(c, VENDOR_ERROR, "Specify bearer capability");
1081 return -EINVAL;
1082 @@ -492,7 +492,7 @@ int control_finish (struct tunnel *t, st
1083 if ((!strlen (t->hostname)) && ((t->chal_them.state) || ((t->chal_us.state))))
1085 if (DEBUG)
1086 - log (LOG_DEBUG,
1087 + do_log (LOG_DEBUG,
1088 "%s: Peer did not specify hostname. Closing.\n",
1089 __FUNCTION__);
1090 set_error (c, VENDOR_ERROR, "Specify your hostname");
1091 @@ -501,7 +501,7 @@ int control_finish (struct tunnel *t, st
1092 if (t->tid <= 0)
1094 if (DEBUG)
1095 - log (LOG_DEBUG,
1096 + do_log (LOG_DEBUG,
1097 "%s: Peer did not specify assigned tunnel ID. Closing.\n",
1098 __FUNCTION__);
1099 set_error (c, VENDOR_ERROR, "Specify your assigned tunnel ID");
1100 @@ -513,7 +513,7 @@ int control_finish (struct tunnel *t, st
1101 if (handle_challenge (t, &t->chal_them))
1103 set_error (c, VENDOR_ERROR, "No secret key on our side");
1104 - log (LOG_WARN, "%s: No secret key for authenticating '%s'\n",
1105 + do_log (LOG_WARN, "%s: No secret key for authenticating '%s'\n",
1106 __FUNCTION__, t->hostname);
1107 return -EINVAL;
1109 @@ -522,7 +522,7 @@ int control_finish (struct tunnel *t, st
1111 set_error (c, VENDOR_ERROR,
1112 "Invalid challenge authentication");
1113 - log (LOG_DEBUG, "%s: Invalid authentication for host '%s'\n",
1114 + do_log (LOG_DEBUG, "%s: Invalid authentication for host '%s'\n",
1115 __FUNCTION__, t->hostname);
1116 return -EINVAL;
1118 @@ -532,7 +532,7 @@ int control_finish (struct tunnel *t, st
1119 t->chal_us.ss = SCCCN;
1120 if (handle_challenge (t, &t->chal_us))
1122 - log (LOG_WARN, "%s: No secret for authenticating to '%s'\n",
1123 + do_log (LOG_WARN, "%s: No secret for authenticating to '%s'\n",
1124 __FUNCTION__, t->hostname);
1125 set_error (c, VENDOR_ERROR, "No secret key on our end");
1126 return -EINVAL;
1127 @@ -563,17 +563,17 @@ int control_finish (struct tunnel *t, st
1128 do_packet_dump (buf);
1129 c->cnu = 0;
1130 if (debug_state)
1131 - log (LOG_DEBUG, "%s: sending SCCCN\n", __FUNCTION__);
1132 + do_log (LOG_DEBUG, "%s: sending SCCCN\n", __FUNCTION__);
1133 control_xmit (buf);
1134 /* Schedule a HELLO */
1135 tv.tv_sec = HELLO_DELAY;
1136 tv.tv_usec = 0;
1137 #ifdef DEBUG_HELLO
1138 - log (LOG_DEBUG, "%s: scheduling initial HELLO on %d\n", __FUNCTION__,
1139 + do_log (LOG_DEBUG, "%s: scheduling initial HELLO on %d\n", __FUNCTION__,
1140 t->ourtid);
1141 #endif
1142 t->hello = schedule (tv, hello, (void *) t);
1143 - log (LOG_LOG,
1144 + do_log (LOG_LOG,
1145 "%s: Connection established to %s, %d. Local: %d, Remote: %d.\n",
1146 __FUNCTION__, IPADDY (t->peer.sin_addr),
1147 ntohs (t->peer.sin_port), t->ourtid, t->tid);
1148 @@ -592,7 +592,7 @@ int control_finish (struct tunnel *t, st
1150 set_error (c, VENDOR_ERROR,
1151 "Invalid challenge authentication");
1152 - log (LOG_DEBUG, "%s: Invalid authentication for host '%s'\n",
1153 + do_log (LOG_DEBUG, "%s: Invalid authentication for host '%s'\n",
1154 __FUNCTION__, t->hostname);
1155 return -EINVAL;
1157 @@ -608,7 +608,7 @@ int control_finish (struct tunnel *t, st
1159 #endif
1160 t->state = SCCCN;
1161 - log (LOG_LOG,
1162 + do_log (LOG_LOG,
1163 "%s: Connection established to %s, %d. Local: %d, Remote: %d. LNS session is '%s'\n",
1164 __FUNCTION__, IPADDY (t->peer.sin_addr),
1165 ntohs (t->peer.sin_port), t->ourtid, t->tid, t->lns->entname);
1166 @@ -616,7 +616,7 @@ int control_finish (struct tunnel *t, st
1167 tv.tv_sec = HELLO_DELAY;
1168 tv.tv_usec = 0;
1169 #ifdef DEBUG_HELLO
1170 - log (LOG_DEBUG, "%s: scheduling initial HELLO on %d\n", __FUNCTION__,
1171 + do_log (LOG_DEBUG, "%s: scheduling initial HELLO on %d\n", __FUNCTION__,
1172 t->ourtid);
1173 #endif
1174 t->hello = schedule (tv, hello, (void *) t);
1175 @@ -625,7 +625,7 @@ int control_finish (struct tunnel *t, st
1176 if (t->qtid < 0)
1178 if (DEBUG)
1179 - log (LOG_DEBUG,
1180 + do_log (LOG_DEBUG,
1181 "%s: Peer tried to disconnect without specifying tunnel ID\n",
1182 __FUNCTION__);
1183 return -EINVAL;
1184 @@ -633,7 +633,7 @@ int control_finish (struct tunnel *t, st
1185 if ((t->qtid != t->tid) && (t->tid > 0))
1187 if (DEBUG)
1188 - log (LOG_DEBUG,
1189 + do_log (LOG_DEBUG,
1190 "%s: Peer tried to disconnect with invalid TID (%d != %d)\n",
1191 __FUNCTION__, t->qtid, t->tid);
1192 return -EINVAL;
1193 @@ -644,12 +644,12 @@ int control_finish (struct tunnel *t, st
1194 if (t->self->result < 0)
1196 if (DEBUG)
1197 - log (LOG_DEBUG,
1198 + do_log (LOG_DEBUG,
1199 "%s: Peer tried to disconnect without specifying result code.\n",
1200 __FUNCTION__);
1201 return -EINVAL;
1203 - log (LOG_LOG,
1204 + do_log (LOG_LOG,
1205 "%s: Connection closed to %s, port %d (%s), Local: %d, Remote: %d\n",
1206 __FUNCTION__, IPADDY (t->peer.sin_addr),
1207 ntohs (t->peer.sin_port), t->self->errormsg, t->ourtid, t->tid);
1208 @@ -670,7 +670,7 @@ int control_finish (struct tunnel *t, st
1209 if (p->cid < 0)
1211 if (DEBUG)
1212 - log (LOG_DEBUG,
1213 + do_log (LOG_DEBUG,
1214 "%s: Peer tried to initiate call without call ID\n",
1215 __FUNCTION__);
1216 /* Here it doesn't make sense to use the needclose flag because
1217 @@ -685,7 +685,7 @@ int control_finish (struct tunnel *t, st
1219 /* This can happen if we get a duplicate
1220 ICRQ or if they don't get our ack packet */
1221 - log (LOG_DEBUG,
1222 + do_log (LOG_DEBUG,
1223 "%s: Peer requested call %d twice, ignoring second one.\n",
1224 __FUNCTION__, p->cid);
1225 p->needclose = 0;
1226 @@ -701,7 +701,7 @@ int control_finish (struct tunnel *t, st
1227 * isn't a big deal, but it would be nice to have *some* sort of check
1228 * for it and perhaps just log it and go on. */
1229 /* JLM if (p->serno<1) {
1230 - if (DEBUG) log(LOG_DEBUG,
1231 + if (DEBUG) do_log(LOG_DEBUG,
1232 "%s: Peer did not specify serial number when initiating call\n", __FUNCTION__);
1233 call_close(p);
1234 return -EINVAL;
1235 @@ -713,7 +713,7 @@ int control_finish (struct tunnel *t, st
1237 set_error (p, ERROR_NORES, "No available IP address");
1238 call_close (p);
1239 - log (LOG_DEBUG, "%s: Out of IP addresses on tunnel %d!\n",
1240 + do_log (LOG_DEBUG, "%s: Out of IP addresses on tunnel %d!\n",
1241 __FUNCTION__, t->tid);
1242 return -EINVAL;
1244 @@ -745,14 +745,14 @@ int control_finish (struct tunnel *t, st
1245 do_packet_dump (buf);
1246 p->cnu = 0;
1247 if (debug_state)
1248 - log (LOG_DEBUG, "%s: Sending ICRP\n", __FUNCTION__);
1249 + do_log (LOG_DEBUG, "%s: Sending ICRP\n", __FUNCTION__);
1250 control_xmit (buf);
1251 break;
1252 case ICRP:
1253 if (c->cid < 0)
1255 if (DEBUG)
1256 - log (LOG_DEBUG,
1257 + do_log (LOG_DEBUG,
1258 "%s: Peer tried to negotiate ICRP without specifying call ID\n",
1259 __FUNCTION__);
1260 c->needclose = -1;
1261 @@ -800,8 +800,8 @@ int control_finish (struct tunnel *t, st
1263 #endif
1264 if (debug_state)
1265 - log (LOG_DEBUG, "%s: Sending ICCN\n", __FUNCTION__);
1266 - log (LOG_LOG,
1267 + do_log (LOG_DEBUG, "%s: Sending ICCN\n", __FUNCTION__);
1268 + do_log (LOG_LOG,
1269 "%s: Call established with %s, Local: %d, Remote: %d, Serial: %d\n",
1270 __FUNCTION__, IPADDY (t->peer.sin_addr), c->ourcid, c->cid,
1271 c->serno);
1272 @@ -860,21 +860,21 @@ int control_finish (struct tunnel *t, st
1273 case ICCN:
1274 if (c == t->self)
1276 - log (LOG_DEBUG,
1277 + do_log (LOG_DEBUG,
1278 "%s: Peer attempted ICCN on the actual tunnel, not the call",
1279 __FUNCTION__);
1280 return -EINVAL;
1282 if (c->txspeed < 1)
1284 - log (LOG_DEBUG,
1285 + do_log (LOG_DEBUG,
1286 "%s: Peer did not specify transmit speed\n", __FUNCTION__);
1287 c->needclose = -1;
1288 return -EINVAL;
1290 if (c->frame < 1)
1292 - log (LOG_DEBUG,
1293 + do_log (LOG_DEBUG,
1294 "%s: Peer did not specify framing type\n", __FUNCTION__);
1295 c->needclose = -1;
1296 return -EINVAL;
1297 @@ -938,7 +938,7 @@ int control_finish (struct tunnel *t, st
1299 start_pppd (c, po);
1300 opt_destroy (po);
1301 - log (LOG_LOG,
1302 + do_log (LOG_LOG,
1303 "%s: Call established with %s, Local: %d, Remote: %d, Serial: %d\n",
1304 __FUNCTION__, IPADDY (t->peer.sin_addr), c->ourcid, c->cid,
1305 c->serno);
1306 @@ -996,7 +996,7 @@ int control_finish (struct tunnel *t, st
1308 start_pppd (c, po);
1310 - log (LOG_LOG, "parameters: Local: %d , Remote: %d , Serial: %d , Pid: %d , Tunnelid: %d , Phoneid: %s\n", c->ourcid, c->cid, c->serno, c->pppd, t->ourtid, c->dial_no); /* jz: just show some information */
1311 + do_log (LOG_LOG, "parameters: Local: %d , Remote: %d , Serial: %d , Pid: %d , Tunnelid: %d , Phoneid: %s\n", c->ourcid, c->cid, c->serno, c->pppd, t->ourtid, c->dial_no); /* jz: just show some information */
1313 opt_destroy (po);
1314 if (c->lac)
1315 @@ -1008,7 +1008,7 @@ int control_finish (struct tunnel *t, st
1316 if (c->qcid < 0)
1318 if (DEBUG)
1319 - log (LOG_DEBUG,
1320 + do_log (LOG_DEBUG,
1321 "%s: Peer tried to disconnect without specifying call ID\n",
1322 __FUNCTION__);
1323 return -EINVAL;
1324 @@ -1021,7 +1021,7 @@ int control_finish (struct tunnel *t, st
1325 if (!p)
1327 if (DEBUG)
1328 - log (LOG_DEBUG,
1329 + do_log (LOG_DEBUG,
1330 "%s: Unable to determine call to be disconnected.\n",
1331 __FUNCTION__);
1332 return -EINVAL;
1333 @@ -1032,7 +1032,7 @@ int control_finish (struct tunnel *t, st
1334 if ((c->qcid != p->cid) && p->cid > 0)
1336 if (DEBUG)
1337 - log (LOG_DEBUG,
1338 + do_log (LOG_DEBUG,
1339 "%s: Peer tried to disconnect with invalid CID (%d != %d)\n",
1340 __FUNCTION__, c->qcid, c->cid);
1341 return -EINVAL;
1342 @@ -1041,12 +1041,12 @@ int control_finish (struct tunnel *t, st
1343 if (c->result < 0)
1345 if (DEBUG)
1346 - log (LOG_DEBUG,
1347 + do_log (LOG_DEBUG,
1348 "%s: Peer tried to disconnect without specifying result code.\n",
1349 __FUNCTION__);
1350 return -EINVAL;
1352 - log (LOG_LOG,
1353 + do_log (LOG_LOG,
1354 "%s: Connection closed to %s, serial %d (%s)\n", __FUNCTION__,
1355 IPADDY (t->peer.sin_addr), c->serno, c->errormsg);
1356 c->needclose = 0;
1357 @@ -1057,7 +1057,7 @@ int control_finish (struct tunnel *t, st
1358 case SLI:
1359 break;
1360 default:
1361 - log (LOG_DEBUG,
1362 + do_log (LOG_DEBUG,
1363 "%s: Don't know how to finish a message of type %d\n",
1364 __FUNCTION__, c->msgtype);
1365 set_error (c, VENDOR_ERROR, "Unimplemented message %d\n", c->msgtype);
1366 @@ -1078,7 +1078,7 @@ inline int check_control (const struct b
1368 if (DEBUG)
1370 - log (LOG_DEBUG,
1371 + do_log (LOG_DEBUG,
1372 "%s: Received too small of packet\n", __FUNCTION__);
1374 return -EINVAL;
1375 @@ -1088,7 +1088,7 @@ inline int check_control (const struct b
1377 if (DEBUG)
1379 - log (LOG_DEBUG,
1380 + do_log (LOG_DEBUG,
1381 "%s: Reported and actual sizes differ (%d != %d)\n",
1382 __FUNCTION__, h->length, buf->len);
1384 @@ -1098,13 +1098,13 @@ inline int check_control (const struct b
1385 * FIXME: H-bit handling goes here
1387 #ifdef DEBUG_CONTROL
1388 - log (LOG_DEBUG, "%s: control, cid = %d, Ns = %d, Nr = %d\n", __FUNCTION__,
1389 + do_log (LOG_DEBUG, "%s: control, cid = %d, Ns = %d, Nr = %d\n", __FUNCTION__,
1390 c->cid, h->Ns, h->Nr);
1391 #endif
1392 if (h->Ns != t->control_rec_seq_num)
1394 if (DEBUG)
1395 - log (LOG_DEBUG,
1396 + do_log (LOG_DEBUG,
1397 "%s: Received out of order control packet on tunnel %d (got %d, expected %d)\n",
1398 __FUNCTION__, t->tid, h->Ns, t->control_rec_seq_num);
1399 if (((h->Ns < t->control_rec_seq_num) &&
1400 @@ -1119,7 +1119,7 @@ inline int check_control (const struct b
1402 #ifdef DEBUG_ZLB
1403 if (DEBUG)
1404 - log (LOG_DEBUG, "%s: Sending an updated ZLB in reponse\n",
1405 + do_log (LOG_DEBUG, "%s: Sending an updated ZLB in reponse\n",
1406 __FUNCTION__);
1407 #endif
1408 zlb = new_outgoing (t);
1409 @@ -1153,7 +1153,7 @@ inline int check_control (const struct b
1411 if (DEBUG)
1413 - log (LOG_DEBUG, "%s: Control bit not set\n", __FUNCTION__);
1414 + do_log (LOG_DEBUG, "%s: Control bit not set\n", __FUNCTION__);
1416 return -EINVAL;
1418 @@ -1161,7 +1161,7 @@ inline int check_control (const struct b
1420 if (DEBUG)
1422 - log (LOG_DEBUG, "%s: Length bit not set\n", __FUNCTION__);
1423 + do_log (LOG_DEBUG, "%s: Length bit not set\n", __FUNCTION__);
1425 return -EINVAL;
1427 @@ -1169,7 +1169,7 @@ inline int check_control (const struct b
1429 if (DEBUG)
1431 - log (LOG_DEBUG, "%s: Flow bit not set\n", __FUNCTION__);
1432 + do_log (LOG_DEBUG, "%s: Flow bit not set\n", __FUNCTION__);
1434 return -EINVAL;
1436 @@ -1179,17 +1179,17 @@ inline int check_control (const struct b
1438 if (CVER (h->ver) == VER_PPTP)
1440 - log (LOG_DEBUG,
1441 + do_log (LOG_DEBUG,
1442 "%s: PPTP packet received\n", __FUNCTION__);
1444 else if (CVER (h->ver) < VER_L2TP)
1446 - log (LOG_DEBUG,
1447 + do_log (LOG_DEBUG,
1448 "%s: L2F packet received\n", __FUNCTION__);
1450 else
1452 - log (LOG_DEBUG,
1453 + do_log (LOG_DEBUG,
1454 "%s: Unknown version received\n", __FUNCTION__);
1457 @@ -1215,7 +1215,7 @@ inline int check_payload (struct buffer
1459 if (DEBUG)
1461 - log (LOG_DEBUG, "%s: Aempted to send payload on tunnel\n",
1462 + do_log (LOG_DEBUG, "%s: Aempted to send payload on tunnel\n",
1463 __FUNCTION__);
1465 return -EINVAL;
1466 @@ -1226,7 +1226,7 @@ inline int check_payload (struct buffer
1467 no matter what. we'll look more later */
1468 if (DEBUG)
1470 - log (LOG_DEBUG, "%s:Recieved to small of packet\n", __FUNCTION__);
1471 + do_log (LOG_DEBUG, "%s:Recieved to small of packet\n", __FUNCTION__);
1473 return -EINVAL;
1475 @@ -1237,7 +1237,7 @@ inline int check_payload (struct buffer
1477 if (DEBUG)
1479 - log (LOG_DEBUG, "%s Control bit set\n", __FUNCTION__);
1480 + do_log (LOG_DEBUG, "%s Control bit set\n", __FUNCTION__);
1482 return -EINVAL;
1484 @@ -1247,7 +1247,7 @@ inline int check_payload (struct buffer
1486 /* if (!c->fbit && !c->ourfbit) {
1487 if (DEBUG)
1488 - log(LOG_DEBUG,"%s: flow bit set, but no RWS negotiated.\n",__FUNCTION__);
1489 + do_log(LOG_DEBUG,"%s: flow bit set, but no RWS negotiated.\n",__FUNCTION__);
1490 return -EINVAL;
1491 } */
1492 ehlen += 4; /* Should have Ns and Nr too */
1493 @@ -1255,7 +1255,7 @@ inline int check_payload (struct buffer
1494 /* if (!PFBIT(h->ver)) {
1495 if (c->fbit || c->ourfbit) {
1496 if (DEBUG)
1497 - log(LOG_DEBUG, "%s: no flow bit, but RWS was negotiated.\n",__FUNCTION__);
1498 + do_log(LOG_DEBUG, "%s: no flow bit, but RWS was negotiated.\n",__FUNCTION__);
1499 return -EINVAL;;
1501 } */
1502 @@ -1269,17 +1269,17 @@ inline int check_payload (struct buffer
1504 if (PVER (h->ver) == VER_PPTP)
1506 - log (LOG_DEBUG, "%s: PPTP packet received\n",
1507 + do_log (LOG_DEBUG, "%s: PPTP packet received\n",
1508 __FUNCTION__);
1510 else if (CVER (h->ver) < VER_L2TP)
1512 - log (LOG_DEBUG, "%s: L2F packet received\n",
1513 + do_log (LOG_DEBUG, "%s: L2F packet received\n",
1514 __FUNCTION__);
1516 else
1518 - log (LOG_DEBUG, "%s: Unknown version received\n",
1519 + do_log (LOG_DEBUG, "%s: Unknown version received\n",
1520 __FUNCTION__);
1523 @@ -1289,7 +1289,7 @@ inline int check_payload (struct buffer
1525 if (DEBUG)
1527 - log (LOG_DEBUG, "%s payload too small (%d < %d)\n",
1528 + do_log (LOG_DEBUG, "%s payload too small (%d < %d)\n",
1529 __FUNCTION__, buf->len, ehlen);
1531 return -EINVAL;
1532 @@ -1298,7 +1298,7 @@ inline int check_payload (struct buffer
1534 if (DEBUG)
1536 - log (LOG_DEBUG, "%s: size mismatch (%d != %d)\n",
1537 + do_log (LOG_DEBUG, "%s: size mismatch (%d != %d)\n",
1538 __FUNCTION__, buf->len, h->length);
1540 return -EINVAL;
1541 @@ -1336,7 +1336,7 @@ inline int expand_payload (struct buffer
1542 new_hdr = (struct payload_hdr *) (buf->start - ehlen);
1543 if ((void *) new_hdr < (void *) buf->rstart)
1545 - log (LOG_WARN, "%s: not enough space to decompress frame\n",
1546 + do_log (LOG_WARN, "%s: not enough space to decompress frame\n",
1547 __FUNCTION__);
1548 return -EINVAL;
1550 @@ -1388,16 +1388,16 @@ inline int expand_payload (struct buffer
1552 /* JLM if (PRBIT(new_hdr->ver)) {
1553 if (c->pSr > new_hdr->Ns) {
1554 - log(LOG_DEBUG, "%s: R-bit set with Ns < pSr!\n",__FUNCTION__);
1555 + do_log(LOG_DEBUG, "%s: R-bit set with Ns < pSr!\n",__FUNCTION__);
1556 return -EINVAL;
1558 #ifdef DEBUG_FLOW
1559 - log(LOG_DEBUG, "%s: R-bit set on packet %d\n",__FUNCTION__,new_hdr->Ns);
1560 + do_log(LOG_DEBUG, "%s: R-bit set on packet %d\n",__FUNCTION__,new_hdr->Ns);
1561 #endif
1562 c->pSr=new_hdr->Ns;
1563 } */
1564 #ifdef DEBUG_PAYLOAD
1565 - log (LOG_DEBUG, "%s: payload, cid = %d, Ns = %d, Nr = %d\n", __FUNCTION__,
1566 + do_log (LOG_DEBUG, "%s: payload, cid = %d, Ns = %d, Nr = %d\n", __FUNCTION__,
1567 c->cid, new_hdr->Ns, new_hdr->Nr);
1568 #endif
1569 if (new_hdr->Ns != c->data_seq_num)
1570 @@ -1410,7 +1410,7 @@ inline int expand_payload (struct buffer
1572 #ifdef DEBUG_FLOW
1573 if (DEBUG)
1574 - log (LOG_DEBUG,
1575 + do_log (LOG_DEBUG,
1576 "%s: Already seen this packet before (%d < %d)\n",
1577 __FUNCTION__, new_hdr->Ns, c->pSr);
1578 #endif
1579 @@ -1421,7 +1421,7 @@ inline int expand_payload (struct buffer
1580 /* FIXME: I should buffer for out of order packets */
1581 #ifdef DEBUG_FLOW
1582 if (DEBUG)
1583 - log (LOG_DEBUG,
1584 + do_log (LOG_DEBUG,
1585 "%s: Oops, lost a packet or two (%d != %d). continuing...\n",
1586 __FUNCTION__, new_hdr->Ns, c->pSr);
1587 #endif
1588 @@ -1431,7 +1431,7 @@ inline int expand_payload (struct buffer
1590 #ifdef DEBUG_FLOW
1591 if (DEBUG)
1592 - log (LOG_DEBUG,
1593 + do_log (LOG_DEBUG,
1594 "%s: Received out of order payload packet (%d != %d)\n",
1595 __FUNCTION__, new_hdr->Ns, c->pSr);
1596 #endif
1597 @@ -1464,13 +1464,13 @@ void send_zlb (void *data)
1598 c = (struct call *) data;
1599 if (!c)
1601 - log (LOG_WARN, "%s: called on NULL call\n", __FUNCTION__);
1602 + do_log (LOG_WARN, "%s: called on NULL call\n", __FUNCTION__);
1603 return;
1605 t = c->container;
1606 if (!t)
1608 - log (LOG_WARN, "%s: called on call with NULL container\n",
1609 + do_log (LOG_WARN, "%s: called on call with NULL container\n",
1610 __FUNCTION__);
1611 return;
1613 @@ -1481,7 +1481,7 @@ void send_zlb (void *data)
1614 c->data_seq_num--; /* We don't increment on ZLB's */
1615 c->zlb_xmit = NULL;
1616 #ifdef DEBUG_ZLB
1617 - log (LOG_DEBUG, "%s: sending payload ZLB\n", __FUNCTION__);
1618 + do_log (LOG_DEBUG, "%s: sending payload ZLB\n", __FUNCTION__);
1619 #endif
1620 udp_xmit (buf);
1621 toss (buf);
1622 @@ -1503,7 +1503,7 @@ inline int write_packet (struct buffer *
1623 if (c->fd < 0)
1625 if (DEBUG)
1626 - log (LOG_DEBUG, "%s: tty is not open yet.\n", __FUNCTION__);
1627 + do_log (LOG_DEBUG, "%s: tty is not open yet.\n", __FUNCTION__);
1628 return -EIO;
1631 @@ -1530,7 +1530,7 @@ inline int write_packet (struct buffer *
1633 else if (err == 0)
1635 - log (LOG_WARN, "%s: wrote no bytes of async packet\n",
1636 + do_log (LOG_WARN, "%s: wrote no bytes of async packet\n",
1637 __FUNCTION__);
1638 return -EINVAL;
1640 @@ -1542,19 +1542,19 @@ inline int write_packet (struct buffer *
1642 else
1644 - log (LOG_WARN, "%s: async write failed: %s\n", __FUNCTION__,
1645 + do_log (LOG_WARN, "%s: async write failed: %s\n", __FUNCTION__,
1646 strerror (errno));
1649 else if (err < buf->len)
1651 - log (LOG_WARN, "%s: short write (%d of %d bytes)\n", __FUNCTION__,
1652 + do_log (LOG_WARN, "%s: short write (%d of %d bytes)\n", __FUNCTION__,
1653 err, buf->len);
1654 return -EINVAL;
1656 else if (err > buf->len)
1658 - log (LOG_WARN, "%s: write returned LONGER than buffer length?\n",
1659 + do_log (LOG_WARN, "%s: write returned LONGER than buffer length?\n",
1660 __FUNCTION__);
1661 return -EINVAL;
1663 @@ -1575,7 +1575,7 @@ inline int write_packet (struct buffer *
1664 // 1 for a possible escape, 1 for the value and 1 to end the PPP stream.
1665 if(pos >= (sizeof(wbuf) - 4)) {
1666 if(DEBUG)
1667 - log(LOG_CRIT, "%s: rx packet is too big after PPP encoding (size %u, max is %u)\n",
1668 + do_log(LOG_CRIT, "%s: rx packet is too big after PPP encoding (size %u, max is %u)\n",
1669 __FUNCTION__, buf->len, MAX_RECV_SIZE);
1670 return -EINVAL;
1672 @@ -1599,7 +1599,7 @@ inline int write_packet (struct buffer *
1673 * everything ended normally
1675 if (DEBUG)
1676 - log (LOG_WARN, "%s: %s(%d)\n", __FUNCTION__, strerror (errno),
1677 + do_log (LOG_WARN, "%s: %s(%d)\n", __FUNCTION__, strerror (errno),
1678 errno);
1679 c->needclose = -1;
1680 c->fd = -1;
1681 @@ -1633,7 +1633,7 @@ void handle_special (struct buffer *buf,
1683 /* If it's a ZLB, we ignore it */
1684 if (debug_tunnel)
1685 - log (LOG_DEBUG, "%s: ZLB for closed call\n", __FUNCTION__);
1686 + do_log (LOG_DEBUG, "%s: ZLB for closed call\n", __FUNCTION__);
1687 c->cid = 0;
1688 return;
1690 @@ -1649,7 +1649,7 @@ void handle_special (struct buffer *buf,
1692 c->cid = 0;
1693 if (debug_tunnel)
1694 - log (LOG_DEBUG, "%s: invalid control packet\n", __FUNCTION__);
1695 + do_log (LOG_DEBUG, "%s: invalid control packet\n", __FUNCTION__);
1699 @@ -1667,7 +1667,7 @@ inline int handle_packet (struct buffer
1700 if (buf->len == sizeof (struct control_hdr))
1702 #ifdef DEBUG_ZLB
1703 - log (LOG_DEBUG, "%s: control ZLB received\n", __FUNCTION__);
1704 + do_log (LOG_DEBUG, "%s: control ZLB received\n", __FUNCTION__);
1705 #endif
1706 t->control_rec_seq_num--;
1707 c->cnu = 0;
1708 @@ -1676,7 +1676,7 @@ inline int handle_packet (struct buffer
1709 if (c->container->cLr >= c->closeSs)
1711 #ifdef DEBUG_ZLB
1712 - log (LOG_DEBUG, "%s: ZLB for closing message found\n",
1713 + do_log (LOG_DEBUG, "%s: ZLB for closing message found\n",
1714 __FUNCTION__);
1715 #endif
1716 c->needclose = 0;
1717 @@ -1692,13 +1692,13 @@ inline int handle_packet (struct buffer
1718 else
1720 if (debug_tunnel)
1721 - log (LOG_DEBUG, "%s: bad AVP handling!\n", __FUNCTION__);
1722 + do_log (LOG_DEBUG, "%s: bad AVP handling!\n", __FUNCTION__);
1723 return -EINVAL;
1726 else
1728 - log (LOG_DEBUG, "%s: bad control packet!\n", __FUNCTION__);
1729 + do_log (LOG_DEBUG, "%s: bad control packet!\n", __FUNCTION__);
1730 return -EINVAL;
1733 @@ -1713,11 +1713,11 @@ inline int handle_packet (struct buffer
1734 /* if (c->throttle) {
1735 if (c->pSs > c->pLr + c->rws) {
1736 #ifdef DEBUG_FLOW
1737 - log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1738 + do_log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1739 #endif
1740 } else {
1741 #ifdef DEBUG_FLOW
1742 - log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1743 + do_log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1744 #endif
1745 if (c->dethrottle) deschedule(c->dethrottle);
1746 c->dethrottle=NULL;
1747 @@ -1739,7 +1739,7 @@ inline int handle_packet (struct buffer
1748 We've received enough to fill our receive window. At
1749 this point, we should immediately send a ZLB!
1750 #ifdef DEBUG_ZLB
1751 - log(LOG_DEBUG, "%s: Sending immediate ZLB!\n",__FUNCTION__);
1752 + do_log(LOG_DEBUG, "%s: Sending immediate ZLB!\n",__FUNCTION__);
1753 #endif
1754 if (c->zlb_xmit) {
1755 Deschedule any existing zlb_xmit's
1756 @@ -1756,7 +1756,7 @@ inline int handle_packet (struct buffer
1757 if (c->zlb_xmit)
1758 deschedule(c->zlb_xmit);
1759 #ifdef DEBUG_ZLB
1760 - log(LOG_DEBUG, "%s: scheduling ZLB\n",__FUNCTION__);
1761 + do_log(LOG_DEBUG, "%s: scheduling ZLB\n",__FUNCTION__);
1762 #endif
1763 c->zlb_xmit = schedule(tv, &send_zlb, (void *)c);
1765 @@ -1766,17 +1766,17 @@ inline int handle_packet (struct buffer
1766 else if (buf->len == sizeof (struct payload_hdr))
1768 #ifdef DEBUG_ZLB
1769 - log (LOG_DEBUG, "%s: payload ZLB received\n",
1770 + do_log (LOG_DEBUG, "%s: payload ZLB received\n",
1771 __FUNCTION__);
1772 #endif
1773 /* if (c->throttle) {
1774 if (c->pSs > c->pLr + c->rws) {
1775 #ifdef DEBUG_FLOW
1776 - log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1777 + do_log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1778 #endif
1779 } else {
1780 #ifdef DEBUG_FLOW
1781 - log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1782 + do_log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1783 #endif
1784 if (c->dethrottle)
1785 deschedule(c->dethrottle);
1786 @@ -1789,21 +1789,21 @@ inline int handle_packet (struct buffer
1788 else
1790 - log (LOG_DEBUG, "%s: payload too small!\n", __FUNCTION__);
1791 + do_log (LOG_DEBUG, "%s: payload too small!\n", __FUNCTION__);
1792 return -EINVAL;
1795 else
1797 if (debug_tunnel)
1798 - log (LOG_DEBUG, "%s: unable to expand payload!\n",
1799 + do_log (LOG_DEBUG, "%s: unable to expand payload!\n",
1800 __FUNCTION__);
1801 return -EINVAL;
1804 else
1806 - log (LOG_DEBUG, "%s: invalid payload packet!\n", __FUNCTION__);
1807 + do_log (LOG_DEBUG, "%s: invalid payload packet!\n", __FUNCTION__);
1808 return -EINVAL;
1811 diff -rdup l2tpd-0.70-pre20031121.oorig/file.c l2tpd-0.70-pre20031121/file.c
1812 --- l2tpd-0.70-pre20031121.oorig/file.c 2004-07-08 22:47:52.000000000 +0200
1813 +++ l2tpd-0.70-pre20031121/file.c 2006-12-28 16:41:59.000000000 +0100
1814 @@ -59,7 +59,7 @@ int init_config ()
1816 else
1818 - log (LOG_CRIT, "%s: Unable to open config file %s or %s\n",
1819 + do_log (LOG_CRIT, "%s: Unable to open config file %s or %s\n",
1820 __FUNCTION__, gconfig.configfile, gconfig.altconfigfile);
1821 return -1;
1823 @@ -77,7 +77,7 @@ struct lns *new_lns ()
1824 tmp = (struct lns *) malloc (sizeof (struct lns));
1825 if (!tmp)
1827 - log (LOG_CRIT, "%s: Unable to allocate memory for new LNS\n",
1828 + do_log (LOG_CRIT, "%s: Unable to allocate memory for new LNS\n",
1829 __FUNCTION__);
1830 return NULL;
1832 @@ -121,7 +121,7 @@ struct lac *new_lac ()
1833 tmp = (struct lac *) malloc (sizeof (struct lac));
1834 if (!tmp)
1836 - log (LOG_CRIT, "%s: Unable to allocate memory for lac entry!\n",
1837 + do_log (LOG_CRIT, "%s: Unable to allocate memory for lac entry!\n",
1838 __FUNCTION__);
1839 return NULL;
1841 @@ -174,7 +174,7 @@ int set_boolean (char *word, char *value
1843 int val;
1844 #ifdef DEBUG_FILE
1845 - log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
1846 + do_log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
1847 #endif /* ; */
1848 if ((val = yesno (value)) < 0)
1850 @@ -190,7 +190,7 @@ int set_int (char *word, char *value, in
1852 int val;
1853 #ifdef DEBUG_FILE
1854 - log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
1855 + do_log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
1856 #endif /* ; */
1857 if ((val = atoi (value)) < 0)
1859 @@ -204,7 +204,7 @@ int set_int (char *word, char *value, in
1860 int set_string (char *word, char *value, char *ptr, int len)
1862 #ifdef DEBUG_FILE
1863 - log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
1864 + do_log (LOG_DEBUG, "set_%s: %s flag to '%s'\n", word, word, value);
1865 #endif /* ; */
1866 strncpy (ptr, value, len);
1867 return 0;
1868 @@ -216,7 +216,7 @@ int set_port (char *word, char *value, i
1870 case CONTEXT_GLOBAL:
1871 #ifdef DEBUG_FILE
1872 - log (LOG_DEBUG, "set_port: Setting global port number to %s\n",
1873 + do_log (LOG_DEBUG, "set_port: Setting global port number to %s\n",
1874 value);
1875 #endif
1876 set_int (word, value, &(((struct global *) item)->port));
1877 @@ -241,7 +241,7 @@ int set_rtimeout (char *word, char *valu
1879 case CONTEXT_LAC:
1880 #ifdef DEBUG_FILE
1881 - log (LOG_DEBUG, "set_rtimeout: Setting redial timeout to %s\n",
1882 + do_log (LOG_DEBUG, "set_rtimeout: Setting redial timeout to %s\n",
1883 value);
1884 #endif
1885 set_int (word, value, &(((struct lac *) item)->rtimeout));
1886 @@ -311,7 +311,7 @@ int set_rmax (char *word, char *value, i
1888 case CONTEXT_LAC:
1889 #ifdef DEBUG_FILE
1890 - log (LOG_DEBUG, "set_rmax: Setting max redials to %s\n", value);
1891 + do_log (LOG_DEBUG, "set_rmax: Setting max redials to %s\n", value);
1892 #endif
1893 set_int (word, value, &(((struct lac *) item)->rmax));
1894 break;
1895 @@ -335,7 +335,7 @@ int set_authfile (char *word, char *valu
1897 case CONTEXT_GLOBAL:
1898 #ifdef DEBUG_FILE
1899 - log (LOG_DEBUG, "set_authfile: Setting global auth file to '%s'\n",
1900 + do_log (LOG_DEBUG, "set_authfile: Setting global auth file to '%s'\n",
1901 value);
1902 #endif /* ; */
1903 strncpy (((struct global *) item)->authfile, value,
1904 @@ -766,7 +766,7 @@ int set_iprange (char *word, char *value
1905 if (!lns->range)
1906 return -1;
1907 #ifdef DEBUG_FILE
1908 - log (LOG_DEBUG, "range start = %x, end = %x, sense=%ud\n",
1909 + do_log (LOG_DEBUG, "range start = %x, end = %x, sense=%ud\n",
1910 ntohl (ipr->start), ntohl (ipr->end), ipr->sense);
1911 #endif
1912 return 0;
1913 @@ -788,7 +788,7 @@ int set_lac (char *word, char *value, in
1914 if (!lns->lacs)
1915 return -1;
1916 #ifdef DEBUG_FILE
1917 - log (LOG_DEBUG, "lac start = %x, end = %x, sense=%ud\n",
1918 + do_log (LOG_DEBUG, "lac start = %x, end = %x, sense=%ud\n",
1919 ntohl (ipr->start), ntohl (ipr->end), ipr->sense);
1920 #endif
1921 return 0;
1922 @@ -830,7 +830,7 @@ int set_listenaddr (char *word, char *va
1924 case CONTEXT_GLOBAL:
1925 #ifdef DEBUG_FILE
1926 - log (LOG_DEBUG, "set_listenaddr: Setting listen address to %s\n",
1927 + do_log (LOG_DEBUG, "set_listenaddr: Setting listen address to %s\n",
1928 value);
1929 #endif
1930 if (set_ip (word, value, &(((struct global *) item)->listenaddr)))
1931 @@ -890,7 +890,7 @@ int set_lns (char *word, char *value, in
1933 case CONTEXT_LAC:
1934 #ifdef DEBUG_FILE
1935 - log (LOG_DEBUG, "set_lns: setting LNS to '%s'\n", value);
1936 + do_log (LOG_DEBUG, "set_lns: setting LNS to '%s'\n", value);
1937 #endif
1938 l = (struct lac *) item;
1939 d = strchr (value, ':');
1940 @@ -934,7 +934,7 @@ int set_lns (char *word, char *value, in
1942 int set_rand_sys ()
1944 - log(LOG_WARN, "The \"rand()\" function call is not a very good source"
1945 + do_log(LOG_WARN, "The \"rand()\" function call is not a very good source"
1946 "of randomness\n");
1947 rand_source = RAND_SYS;
1948 return 0;
1949 @@ -948,7 +948,7 @@ int set_rand_dev ()
1951 int set_rand_egd (char *value)
1953 - log(LOG_WARN, "%s: not yet implemented!\n", __FUNCTION__);
1954 + do_log(LOG_WARN, "%s: not yet implemented!\n", __FUNCTION__);
1955 rand_source = RAND_EGD;
1956 return -1;
1958 @@ -976,7 +976,7 @@ int set_rand_source (char *word, char *v
1960 if (context != CONTEXT_GLOBAL)
1962 - log(LOG_WARN, "%s: %s not valid in context %d\n",
1963 + do_log(LOG_WARN, "%s: %s not valid in context %d\n",
1964 __FUNCTION__, word, context);
1965 return -1;
1967 @@ -1000,7 +1000,7 @@ int set_rand_source (char *word, char *v
1969 else
1971 - log(LOG_WARN, "%s: %s is not a valid randomness source\n",
1972 + do_log(LOG_WARN, "%s: %s is not a valid randomness source\n",
1973 __FUNCTION__, value);
1974 return -1;
1976 @@ -1046,7 +1046,7 @@ int parse_config (FILE * f)
1977 /* We've got a context description */
1978 if (!(t = strchr (s, ']')))
1980 - log (LOG_CRIT, "parse_config: line %d: No closing bracket\n",
1981 + do_log (LOG_CRIT, "parse_config: line %d: No closing bracket\n",
1982 linenum);
1983 return -1;
1985 @@ -1066,7 +1066,7 @@ int parse_config (FILE * f)
1987 context = CONTEXT_GLOBAL;
1988 #ifdef DEBUG_FILE
1989 - log (LOG_DEBUG,
1990 + do_log (LOG_DEBUG,
1991 "parse_config: global context descriptor %s\n",
1992 d ? d : "");
1993 #endif
1994 @@ -1111,7 +1111,7 @@ int parse_config (FILE * f)
1995 strncpy (((struct lns *) data)->entname,
1996 d, sizeof (((struct lns *) data)->entname));
1997 #ifdef DEBUG_FILE
1998 - log (LOG_DEBUG, "parse_config: lns context descriptor %s\n",
1999 + do_log (LOG_DEBUG, "parse_config: lns context descriptor %s\n",
2000 d ? d : "");
2001 #endif
2003 @@ -1154,13 +1154,13 @@ int parse_config (FILE * f)
2004 strncpy (((struct lac *) data)->entname,
2005 d, sizeof (((struct lac *) data)->entname));
2006 #ifdef DEBUG_FILE
2007 - log (LOG_DEBUG, "parse_config: lac context descriptor %s\n",
2008 + do_log (LOG_DEBUG, "parse_config: lac context descriptor %s\n",
2009 d ? d : "");
2010 #endif
2012 else
2014 - log (LOG_WARN,
2015 + do_log (LOG_WARN,
2016 "parse_config: line %d: unknown context '%s'\n", linenum,
2018 return -1;
2019 @@ -1170,14 +1170,14 @@ int parse_config (FILE * f)
2021 if (!context)
2023 - log (LOG_WARN,
2024 + do_log (LOG_WARN,
2025 "parse_config: line %d: data '%s' occurs with no context\n",
2026 linenum, s);
2027 return -1;
2029 if (!(t = strchr (s, '=')))
2031 - log (LOG_WARN, "parse_config: line %d: no '=' in data\n",
2032 + do_log (LOG_WARN, "parse_config: line %d: no '=' in data\n",
2033 linenum);
2034 return -1;
2036 @@ -1191,7 +1191,7 @@ int parse_config (FILE * f)
2037 while (*t && (*t < 33))
2038 t++;
2039 #ifdef DEBUG_FILE
2040 - log (LOG_DEBUG, "parse_config: field is %s, value is %s\n", s, t);
2041 + do_log (LOG_DEBUG, "parse_config: field is %s, value is %s\n", s, t);
2042 #endif
2043 /* Okay, bit twidling is done. Let's handle this */
2044 for (kw = words; kw->keyword; kw++)
2045 @@ -1200,7 +1200,7 @@ int parse_config (FILE * f)
2047 if (kw->handler (s, t, context | def, data))
2049 - log (LOG_WARN, "parse_config: line %d: %s", linenum,
2050 + do_log (LOG_WARN, "parse_config: line %d: %s", linenum,
2051 filerr);
2052 return -1;
2054 @@ -1209,7 +1209,7 @@ int parse_config (FILE * f)
2056 if (!kw->keyword)
2058 - log (LOG_CRIT, "parse_config: line %d: Unknown field '%s'\n",
2059 + do_log (LOG_CRIT, "parse_config: line %d: Unknown field '%s'\n",
2060 linenum, s);
2061 return -1;
2063 diff -rdup l2tpd-0.70-pre20031121.oorig/l2tpd.c l2tpd-0.70-pre20031121/l2tpd.c
2064 --- l2tpd-0.70-pre20031121.oorig/l2tpd.c 2006-12-28 16:30:10.000000000 +0100
2065 +++ l2tpd-0.70-pre20031121/l2tpd.c 2006-12-28 16:41:59.000000000 +0100
2066 @@ -71,8 +71,8 @@ void show_status (void)
2067 struct lac *tlac;
2068 struct host *h;
2069 int s = 0;
2070 - log (LOG_WARN, "====== l2tpd statistics ========\n");
2071 - log (LOG_WARN, " Scheduler entries:\n");
2072 + do_log (LOG_WARN, "====== l2tpd statistics ========\n");
2073 + do_log (LOG_WARN, " Scheduler entries:\n");
2074 se = events;
2075 while (se)
2077 @@ -82,32 +82,32 @@ void show_status (void)
2078 c = (struct call *) se->data;
2079 if (se->func == &hello)
2081 - log (LOG_WARN, "%d: HELLO to %d\n", s, t->tid);
2082 + do_log (LOG_WARN, "%d: HELLO to %d\n", s, t->tid);
2084 else if (se->func == &magic_lac_dial)
2086 - log (LOG_WARN, "%d: Magic dial on %s\n", s, tlac->entname);
2087 + do_log (LOG_WARN, "%d: Magic dial on %s\n", s, tlac->entname);
2089 else if (se->func == &send_zlb)
2091 - log (LOG_WARN, "%d: Send payload ZLB on call %d:%d\n", s,
2092 + do_log (LOG_WARN, "%d: Send payload ZLB on call %d:%d\n", s,
2093 c->container->tid, c->cid);
2095 else if (se->func == &dethrottle)
2097 - log (LOG_WARN, "%d: Dethrottle call %d:%d\n", s, c->container->tid,
2098 + do_log (LOG_WARN, "%d: Dethrottle call %d:%d\n", s, c->container->tid,
2099 c->cid);
2101 else
2102 - log (LOG_WARN, "%d: Unknown event\n", s);
2103 + do_log (LOG_WARN, "%d: Unknown event\n", s);
2104 se = se->next;
2106 - log (LOG_WARN, "Total Events scheduled: %d\n", s);
2107 - log (LOG_WARN, "Number of tunnels open: %d\n", tunnels.count);
2108 + do_log (LOG_WARN, "Total Events scheduled: %d\n", s);
2109 + do_log (LOG_WARN, "Number of tunnels open: %d\n", tunnels.count);
2110 t = tunnels.head;
2111 while (t)
2113 - log (LOG_WARN, "Tunnel %s, ID = %d (local), %d (remote) to %s:%d\n"
2114 + do_log (LOG_WARN, "Tunnel %s, ID = %d (local), %d (remote) to %s:%d\n"
2115 " control_seq_num = %d, control_rec_seq_num = %d,\n"
2116 " cLr = %d\n",
2117 (t->lac ? t->lac->entname : (t->lns ? t->lns->entname : "")),
2118 @@ -117,7 +117,7 @@ void show_status (void)
2119 c = t->call_head;
2120 while (c)
2122 - log (LOG_WARN,
2123 + do_log (LOG_WARN,
2124 "Call %s, ID = %d (local), %d (remote), serno = %u,\n"
2125 " data_seq_num = %d, data_rec_seq_num = %d,\n"
2126 " pLr = %d, tx = %u bytes (%u), rx= %u bytes (%u)\n",
2127 @@ -129,34 +129,34 @@ void show_status (void)
2129 t = t->next;
2131 - log (LOG_WARN, "==========Config File===========\n");
2132 + do_log (LOG_WARN, "==========Config File===========\n");
2133 tlns = lnslist;
2134 while (tlns)
2136 - log (LOG_WARN, "LNS entry %s\n",
2137 + do_log (LOG_WARN, "LNS entry %s\n",
2138 tlns->entname[0] ? tlns->entname : "(unnamed)");
2139 tlns = tlns->next;
2141 tlac = laclist;
2142 while (tlac)
2144 - log (LOG_WARN, "LAC entry %s, LNS is/are:",
2145 + do_log (LOG_WARN, "LAC entry %s, LNS is/are:",
2146 tlac->entname[0] ? tlac->entname : "(unnamed)");
2147 h = tlac->lns;
2148 if (h)
2150 while (h)
2152 - log (LOG_WARN, " %s", h->hostname);
2153 + do_log (LOG_WARN, " %s", h->hostname);
2154 h = h->next;
2157 else
2158 - log (LOG_WARN, " [none]");
2159 - log (LOG_WARN, "\n");
2160 + do_log (LOG_WARN, " [none]");
2161 + do_log (LOG_WARN, "\n");
2162 tlac = tlac->next;
2164 - log (LOG_WARN, "================================\n");
2165 + do_log (LOG_WARN, "================================\n");
2168 void null_handler(int sig)
2169 @@ -206,17 +206,17 @@ void child_handler (int signal)
2171 if ( WIFEXITED( status ) )
2173 - log (LOG_DEBUG, "%s : pppd exited for call %d with code %d\n", __FUNCTION__,
2174 + do_log (LOG_DEBUG, "%s : pppd exited for call %d with code %d\n", __FUNCTION__,
2175 c->cid, WEXITSTATUS( status ) );
2177 else if( WIFSIGNALED( status ) )
2179 - log (LOG_DEBUG, "%s : pppd terminated for call %d by signal %d\n", __FUNCTION__,
2180 + do_log (LOG_DEBUG, "%s : pppd terminated for call %d by signal %d\n", __FUNCTION__,
2181 c->cid, WTERMSIG( status ) );
2183 else
2185 - log (LOG_DEBUG, "%s : pppd exited for call %d for unknown reason\n", __FUNCTION__,
2186 + do_log (LOG_DEBUG, "%s : pppd exited for call %d for unknown reason\n", __FUNCTION__,
2187 c->cid );
2189 c->needclose = -1;
2190 @@ -245,7 +245,7 @@ void death_handler (int signal)
2192 struct tunnel *st, *st2;
2193 int sec;
2194 - log (LOG_CRIT, "%s: Fatal signal %d received\n", __FUNCTION__, signal);
2195 + do_log (LOG_CRIT, "%s: Fatal signal %d received\n", __FUNCTION__, signal);
2196 st = tunnels.head;
2197 while (st)
2199 @@ -300,12 +300,12 @@ int start_pppd (struct call *c, struct p
2200 stropt[pos] = NULL;
2201 if (c->pppd > 0)
2203 - log (LOG_WARN, "%s: PPP already started on call!\n", __FUNCTION__);
2204 + do_log (LOG_WARN, "%s: PPP already started on call!\n", __FUNCTION__);
2205 return -EINVAL;
2207 if (c->fd > -1)
2209 - log (LOG_WARN, "%s: file descriptor already assigned!\n",
2210 + do_log (LOG_WARN, "%s: file descriptor already assigned!\n",
2211 __FUNCTION__);
2212 return -EINVAL;
2214 @@ -326,7 +326,7 @@ int start_pppd (struct call *c, struct p
2215 #endif
2216 if ((c->fd = getPtyMaster (&a, &b)) < 0)
2218 - log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n",
2219 + do_log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n",
2220 __FUNCTION__);
2221 return -EINVAL;
2223 @@ -342,7 +342,7 @@ int start_pppd (struct call *c, struct p
2224 snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b);
2225 fd2 = open (tty, O_RDWR);
2226 if(!fd2)
2227 - log(LOG_WARN, "unable to open tty %s", tty);
2228 + do_log(LOG_WARN, "unable to open tty %s", tty);
2230 /* XXX JEF: CHECK ME */
2231 stropt[pos++] = strdup(tty);
2232 @@ -353,17 +353,17 @@ int start_pppd (struct call *c, struct p
2233 #endif
2234 str = stropt[0];
2235 #ifdef DEBUG_PPPD
2236 - log (LOG_DEBUG, "%s: I'm running: ", __FUNCTION__);
2237 + do_log (LOG_DEBUG, "%s: I'm running: ", __FUNCTION__);
2238 for (x = 0; stropt[x]; x++)
2240 - log (LOG_DEBUG, "\"%s\" ", stropt[x]);
2241 + do_log (LOG_DEBUG, "\"%s\" ", stropt[x]);
2243 - log (LOG_DEBUG, "\n");
2244 + do_log (LOG_DEBUG, "\n");
2245 #endif
2246 c->pppd = fork ();
2247 if (c->pppd < 0)
2249 - log (LOG_WARN, "%s: unable to fork(), abandoning!\n", __FUNCTION__);
2250 + do_log (LOG_WARN, "%s: unable to fork(), abandoning!\n", __FUNCTION__);
2251 return -EINVAL;
2253 else if (!c->pppd)
2254 @@ -380,7 +380,7 @@ int start_pppd (struct call *c, struct p
2255 if (fd2 < 0)
2256 #endif
2258 - log (LOG_WARN, "%s: Unable to open %s to launch pppd!\n",
2259 + do_log (LOG_WARN, "%s: Unable to open %s to launch pppd!\n",
2260 __FUNCTION__, tty);
2261 exit (1);
2263 @@ -412,7 +412,7 @@ int start_pppd (struct call *c, struct p
2264 setenv( "CALLER_ID", c->dialing, 1 );
2266 execv (PPPD, stropt);
2267 - log (LOG_WARN, "%s: Exec of %s failed!\n", __FUNCTION__, PPPD);
2268 + do_log (LOG_WARN, "%s: Exec of %s failed!\n", __FUNCTION__, PPPD);
2269 exit (1);
2271 close (fd2);
2272 @@ -481,14 +481,14 @@ void destroy_tunnel (struct tunnel *t)
2274 else
2276 - log (LOG_WARN,
2277 + do_log (LOG_WARN,
2278 "%s: unable to locate tunnel in tunnel list\n",
2279 __FUNCTION__);
2282 else
2284 - log (LOG_WARN, "%s: tunnel list is empty!\n", __FUNCTION__);
2285 + do_log (LOG_WARN, "%s: tunnel list is empty!\n", __FUNCTION__);
2288 if (t->lac)
2289 @@ -497,7 +497,7 @@ void destroy_tunnel (struct tunnel *t)
2290 if (t->lac->redial && (t->lac->rtimeout > 0) && !t->lac->rsched &&
2291 t->lac->active)
2293 - log (LOG_LOG, "%s: Will redial in %d seconds\n", __FUNCTION__,
2294 + do_log (LOG_LOG, "%s: Will redial in %d seconds\n", __FUNCTION__,
2295 t->lac->rtimeout);
2296 tv.tv_sec = t->lac->rtimeout;
2297 tv.tv_usec = 0;
2298 @@ -527,7 +527,7 @@ struct tunnel *l2tp_call (char *host, in
2299 hp = gethostbyname (host);
2300 if (!hp)
2302 - log (LOG_WARN, "%s: gethostbyname() failed for %s.\n", __FUNCTION__,
2303 + do_log (LOG_WARN, "%s: gethostbyname() failed for %s.\n", __FUNCTION__,
2304 host);
2305 return NULL;
2307 @@ -540,7 +540,7 @@ struct tunnel *l2tp_call (char *host, in
2308 tmp = get_call (0, 0, addr, port);
2309 if (!tmp)
2311 - log (LOG_WARN, "%s: Unable to create tunnel to %s.\n", __FUNCTION__,
2312 + do_log (LOG_WARN, "%s: Unable to create tunnel to %s.\n", __FUNCTION__,
2313 host);
2314 return NULL;
2316 @@ -556,7 +556,7 @@ struct tunnel *l2tp_call (char *host, in
2318 * Since our state is 0, we will establish a tunnel now
2320 - log (LOG_LOG, "%s:Connecting to host %s, port %d\n", __FUNCTION__, host,
2321 + do_log (LOG_LOG, "%s:Connecting to host %s, port %d\n", __FUNCTION__, host,
2322 ntohs (port));
2323 control_finish (tmp->container, tmp);
2324 return tmp->container;
2325 @@ -568,7 +568,7 @@ void magic_lac_tunnel (void *data)
2326 lac = (struct lac *) data;
2327 if (!lac)
2329 - log (LOG_WARN, "%s: magic_lac_tunnel: called on NULL lac!\n",
2330 + do_log (LOG_WARN, "%s: magic_lac_tunnel: called on NULL lac!\n",
2331 __FUNCTION__);
2332 return;
2334 @@ -585,7 +585,7 @@ void magic_lac_tunnel (void *data)
2336 else
2338 - log (LOG_WARN, "%s: Unable to find hostname to dial for '%s'\n",
2339 + do_log (LOG_WARN, "%s: Unable to find hostname to dial for '%s'\n",
2340 __FUNCTION__, lac->entname);
2341 return;
2343 @@ -602,7 +602,7 @@ struct call *lac_call (int tid, struct l
2344 tmp = new_call (t);
2345 if (!tmp)
2347 - log (LOG_WARN, "%s: unable to create new call\n",
2348 + do_log (LOG_WARN, "%s: unable to create new call\n",
2349 __FUNCTION__);
2350 return NULL;
2352 @@ -614,14 +614,14 @@ struct call *lac_call (int tid, struct l
2353 tmp->lns = lns;
2354 if (lac)
2355 lac->c = tmp;
2356 - log (LOG_LOG, "%s: Calling on tunnel %d\n", __FUNCTION__, tid);
2357 + do_log (LOG_LOG, "%s: Calling on tunnel %d\n", __FUNCTION__, tid);
2358 strcpy (tmp->dial_no, dial_no_tmp); /* jz: copy dialnumber to tmp->dial_no */
2359 control_finish (t, tmp);
2360 return tmp;
2362 t = t->next;
2364 - log (LOG_DEBUG, "%s: No such tunnel %d to generate call.\n", __FUNCTION__,
2365 + do_log (LOG_DEBUG, "%s: No such tunnel %d to generate call.\n", __FUNCTION__,
2366 tid);
2367 return NULL;
2369 @@ -633,25 +633,25 @@ void magic_lac_dial (void *data)
2371 if (!lac)
2373 - log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__);
2374 + do_log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__);
2375 return;
2377 if (!lac->active)
2379 - log (LOG_DEBUG, "%s: LAC %s not active", __FUNCTION__, lac->entname);
2380 + do_log (LOG_DEBUG, "%s: LAC %s not active", __FUNCTION__, lac->entname);
2381 return;
2383 lac->rsched = NULL;
2384 lac->rtries++;
2385 if (lac->rmax && (lac->rtries > lac->rmax))
2387 - log (LOG_LOG, "%s: maximum retries exceeded.\n", __FUNCTION__);
2388 + do_log (LOG_LOG, "%s: maximum retries exceeded.\n", __FUNCTION__);
2389 return;
2391 if (!lac->t)
2393 #ifdef DEGUG_MAGIC
2394 - log (LOG_DEBUG, "%s : tunnel not up! Connecting!\n", __FUNCTION__);
2395 + do_log (LOG_DEBUG, "%s : tunnel not up! Connecting!\n", __FUNCTION__);
2396 #endif
2397 magic_lac_tunnel (lac);
2398 return;
2399 @@ -670,7 +670,7 @@ void lac_hangup (int cid)
2401 if (tmp->ourcid == cid)
2403 - log (LOG_LOG,
2404 + do_log (LOG_LOG,
2405 "%s :Hanging up call %d, Local: %d, Remote: %d\n",
2406 __FUNCTION__, tmp->serno, tmp->ourcid, tmp->cid);
2407 strcpy (tmp->errormsg, "Goodbye!");
2408 @@ -682,7 +682,7 @@ void lac_hangup (int cid)
2410 t = t->next;
2412 - log (LOG_DEBUG, "%s : No such call %d to hang up.\n", __FUNCTION__, cid);
2413 + do_log (LOG_DEBUG, "%s : No such call %d to hang up.\n", __FUNCTION__, cid);
2414 return;
2417 @@ -693,7 +693,7 @@ void lac_disconnect (int tid)
2419 if (t->ourtid == tid)
2421 - log (LOG_LOG,
2422 + do_log (LOG_LOG,
2423 "%s: Disconnecting from %s, Local: %d, Remote: %d\n",
2424 __FUNCTION__, IPADDY (t->peer.sin_addr), t->ourtid, t->tid);
2425 t->self->needclose = -1;
2426 @@ -703,7 +703,7 @@ void lac_disconnect (int tid)
2428 t = t->next;
2430 - log (LOG_DEBUG, "%s: No such tunnel %d to hang up.\n", __FUNCTION__, tid);
2431 + do_log (LOG_DEBUG, "%s: No such tunnel %d to hang up.\n", __FUNCTION__, tid);
2432 return;
2435 @@ -736,7 +736,7 @@ struct tunnel *new_tunnel ()
2436 temp = (int *)entropy_buf;
2437 tmp->ourtid = *temp & 0xFFFF;
2438 #ifdef DEBUG_ENTROPY
2439 - log(LOG_DEBUG, "ourtid = %u, entropy_buf = %hx\n", tmp->ourtid, *temp);
2440 + do_log(LOG_DEBUG, "ourtid = %u, entropy_buf = %hx\n", tmp->ourtid, *temp);
2441 #endif
2443 #else
2444 @@ -797,7 +797,7 @@ void do_control ()
2445 if (buf[cnt - 1] == '\n')
2446 buf[--cnt] = 0;
2447 #ifdef DEBUG_CONTROL
2448 - log (LOG_DEBUG, "%s: Got message \"%s\" (%d bytes long)\n",
2449 + do_log (LOG_DEBUG, "%s: Got message \"%s\" (%d bytes long)\n",
2450 __FUNCTION__, buf, cnt);
2451 #endif
2452 switch (buf[0])
2453 @@ -808,7 +808,7 @@ void do_control ()
2454 goto out;
2455 host++;
2456 #ifdef DEBUG_CONTROL
2457 - log (LOG_DEBUG, "%s: Attempting to tunnel to %s\n",
2458 + do_log (LOG_DEBUG, "%s: Attempting to tunnel to %s\n",
2459 __FUNCTION__, host);
2460 #endif
2461 l2tp_call (host, UDP_LISTEN_PORT, NULL, NULL);
2462 @@ -840,7 +840,7 @@ void do_control ()
2463 if (!lac->c)
2464 magic_lac_dial (lac);
2465 else
2466 - log (LOG_DEBUG,
2467 + do_log (LOG_DEBUG,
2468 "%s: Session '%s' already active!\n",
2469 __FUNCTION__, lac->entname);
2470 break;
2471 @@ -852,12 +852,12 @@ void do_control ()
2472 tunl = atoi (tunstr);
2473 if (!tunl)
2475 - log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
2476 + do_log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
2477 tunstr);
2478 break;
2480 #ifdef DEBUG_CONTROL
2481 - log (LOG_DEBUG, "%s: Attempting to call on tunnel %d\n",
2482 + do_log (LOG_DEBUG, "%s: Attempting to call on tunnel %d\n",
2483 __FUNCTION__, tunl);
2484 #endif
2485 lac_call (tunl, NULL, NULL);
2486 @@ -870,7 +870,7 @@ void do_control ()
2488 call = atoi (callstr);
2489 #ifdef DEBUG_CONTROL
2490 - log (LOG_DEBUG, "%s: Attempting to call %d\n", __FUNCTION__,
2491 + do_log (LOG_DEBUG, "%s: Attempting to call %d\n", __FUNCTION__,
2492 call);
2493 #endif
2494 lac_hangup (call);
2495 @@ -891,7 +891,7 @@ void do_control ()
2496 if (lac->t)
2497 lac_disconnect (lac->t->ourtid);
2498 else
2499 - log (LOG_DEBUG, "%s: Session '%s' not up\n",
2500 + do_log (LOG_DEBUG, "%s: Session '%s' not up\n",
2501 __FUNCTION__, lac->entname);
2502 break;
2504 @@ -902,12 +902,12 @@ void do_control ()
2505 tunl = atoi (tunstr);
2506 if (!tunl)
2508 - log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
2509 + do_log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
2510 tunstr);
2511 break;
2513 #ifdef DEBUG_CONTROL
2514 - log (LOG_DEBUG, "%s: Attempting to disconnect tunnel %d\n",
2515 + do_log (LOG_DEBUG, "%s: Attempting to disconnect tunnel %d\n",
2516 __FUNCTION__, tunl);
2517 #endif
2518 lac_disconnect (tunl);
2519 @@ -916,7 +916,7 @@ void do_control ()
2520 show_status ();
2521 break;
2522 default:
2523 - log (LOG_DEBUG, "%s: Unknown command %c\n", __FUNCTION__,
2524 + do_log (LOG_DEBUG, "%s: Unknown command %c\n", __FUNCTION__,
2525 buf[0]);
2528 @@ -990,7 +990,7 @@ void daemonize() {
2529 char buf[STRLEN];
2531 if((pid = fork()) < 0) {
2532 - log(LOG_LOG, "%s: Unable to fork ()\n",__FUNCTION__);
2533 + do_log(LOG_LOG, "%s: Unable to fork ()\n",__FUNCTION__);
2534 close(server_socket);
2535 exit(1);
2537 @@ -1016,7 +1016,7 @@ void daemonize() {
2539 /* if pid is read and process exist exit */
2540 if(pid && !kill(pid, 0)) {
2541 - log(LOG_LOG, "%s: There's already a l2tpd server running.\n",
2542 + do_log(LOG_LOG, "%s: There's already a l2tpd server running.\n",
2543 __FUNCTION__);
2544 close(server_socket);
2545 exit(1);
2546 @@ -1035,7 +1035,7 @@ void daemonize() {
2547 close (i);
2549 else {
2550 - log(LOG_LOG, "%s: could not write pid file %s error %d",
2551 + do_log(LOG_LOG, "%s: could not write pid file %s error %d",
2552 __FUNCTION__, gconfig.pidfile, i);
2553 close(server_socket);
2554 exit(1);
2555 @@ -1054,12 +1054,12 @@ void init (int argc,char *argv[])
2556 init_addr ();
2557 if (init_config ())
2559 - log (LOG_CRIT, "%s: Unable to load config file\n", __FUNCTION__);
2560 + do_log (LOG_CRIT, "%s: Unable to load config file\n", __FUNCTION__);
2561 exit (1);
2563 if (uname (&uts))
2565 - log (LOG_CRIT, "%s : Unable to determine host system\n",
2566 + do_log (LOG_CRIT, "%s : Unable to determine host system\n",
2567 __FUNCTION__);
2568 exit (1);
2570 @@ -1078,14 +1078,14 @@ void init (int argc,char *argv[])
2571 control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600);
2572 if (control_fd < 0)
2574 - log (LOG_CRIT, "%s: Unable to open " CONTROL_PIPE " for reading.",
2575 + do_log (LOG_CRIT, "%s: Unable to open " CONTROL_PIPE " for reading.",
2576 __FUNCTION__);
2577 exit (1);
2579 - log (LOG_LOG, "l2tpd version " SERVER_VERSION " started on %s PID:%d\n",
2580 + do_log (LOG_LOG, "l2tpd version " SERVER_VERSION " started on %s PID:%d\n",
2581 hostname, getpid ());
2582 listenaddr.s_addr = gconfig.listenaddr;
2583 - log (LOG_LOG, "%s version %s on a %s, listening on IP address %s, port %d\n", uts.sysname,
2584 + do_log (LOG_LOG, "%s version %s on a %s, listening on IP address %s, port %d\n", uts.sysname,
2585 uts.release, uts.machine, inet_ntoa(listenaddr), gconfig.port);
2586 lac = laclist;
2587 while (lac)
2588 @@ -1093,7 +1093,7 @@ void init (int argc,char *argv[])
2589 if (lac->autodial)
2591 #ifdef DEBUG_MAGIC
2592 - log (LOG_DEBUG, "%s: Autodialing '%s'\n", __FUNCTION__,
2593 + do_log (LOG_DEBUG, "%s: Autodialing '%s'\n", __FUNCTION__,
2594 lac->entname[0] ? lac->entname : "(unnamed)");
2595 #endif
2596 lac->active = -1;
2597 diff -rdup l2tpd-0.70-pre20031121.oorig/misc.c l2tpd-0.70-pre20031121/misc.c
2598 --- l2tpd-0.70-pre20031121.oorig/misc.c 2006-12-28 16:30:10.000000000 +0100
2599 +++ l2tpd-0.70-pre20031121/misc.c 2006-12-28 16:41:59.000000000 +0100
2600 @@ -32,7 +32,7 @@
2601 #include "l2tp.h"
2604 -void log (int level, const char *fmt, ...)
2605 +void do_log (int level, const char *fmt, ...)
2607 char buf[256];
2608 va_list args;
2609 @@ -101,7 +101,7 @@ void bufferDump (char *buf, int buflen)
2610 c++; /* again two characters to display ONE byte */
2612 *c = '\0';
2613 - log (LOG_WARN, "%s: buflen=%d, buffer[%d]: *%s*\n", __FUNCTION__,
2614 + do_log (LOG_WARN, "%s: buflen=%d, buffer[%d]: *%s*\n", __FUNCTION__,
2615 buflen, i, line);
2618 @@ -117,7 +117,7 @@ void bufferDump (char *buf, int buflen)
2619 if (c != line)
2621 *c = '\0';
2622 - log (LOG_WARN, "%s: buffer[%d]: *%s*\n", __FUNCTION__, i,
2623 + do_log (LOG_WARN, "%s: buffer[%d]: *%s*\n", __FUNCTION__, i,
2624 line);
2627 @@ -201,7 +201,7 @@ struct ppp_opts *add_opt (struct ppp_opt
2628 new = (struct ppp_opts *) malloc (sizeof (struct ppp_opts));
2629 if (!new)
2631 - log (LOG_WARN,
2632 + do_log (LOG_WARN,
2633 "%s : Unable to allocate ppp option memory. Expect a crash\n",
2634 __FUNCTION__);
2635 return NULL;
2636 @@ -267,7 +267,7 @@ int get_dev_entropy(char *buf, int count
2637 if (devrandom == -1)
2639 #ifdef DEBUG_ENTROPY
2640 - log(LOG_WARN, "%s: couldn't open /dev/urandom,"
2641 + do_log(LOG_WARN, "%s: couldn't open /dev/urandom,"
2642 "falling back to rand()\n",
2643 __FUNCTION__);
2644 #endif
2645 @@ -290,13 +290,13 @@ int get_entropy (char *buf, int count)
2647 else if (rand_source == RAND_EGD)
2649 - log(LOG_WARN, "%s: EGD Randomness source not yet implemented\n",
2650 + do_log(LOG_WARN, "%s: EGD Randomness source not yet implemented\n",
2651 __FUNCTION__);
2652 return -1;
2654 else
2656 - log(LOG_WARN, "%s: Invalid Randomness source specified (%d)\n",
2657 + do_log(LOG_WARN, "%s: Invalid Randomness source specified (%d)\n",
2658 __FUNCTION__, rand_source);
2659 return -1;
2661 diff -rdup l2tpd-0.70-pre20031121.oorig/misc.h l2tpd-0.70-pre20031121/misc.h
2662 --- l2tpd-0.70-pre20031121.oorig/misc.h 2006-12-28 16:30:10.000000000 +0100
2663 +++ l2tpd-0.70-pre20031121/misc.h 2006-12-28 16:42:01.000000000 +0100
2664 @@ -66,7 +66,7 @@ struct ppp_opts
2665 #define halt() printf("Halted.\n") ; for(;;)
2667 extern char hostname[];
2668 -extern void log (int level, const char *fmt, ...);
2669 +extern void do_log (int level, const char *fmt, ...);
2670 extern struct buffer *new_buf (int);
2671 extern void udppush_handler (int);
2672 extern int addfcs (struct buffer *buf);
2673 diff -rdup l2tpd-0.70-pre20031121.oorig/network.c l2tpd-0.70-pre20031121/network.c
2674 --- l2tpd-0.70-pre20031121.oorig/network.c 2006-12-28 16:30:10.000000000 +0100
2675 +++ l2tpd-0.70-pre20031121/network.c 2006-12-28 16:41:59.000000000 +0100
2676 @@ -52,7 +52,7 @@ int init_network (void)
2677 server.sin_port = htons (gconfig.port);
2678 if ((server_socket = socket (PF_INET, SOCK_DGRAM, 0)) < 0)
2680 - log (LOG_CRIT, "%s: Unable to allocate socket. Terminating.\n",
2681 + do_log (LOG_CRIT, "%s: Unable to allocate socket. Terminating.\n",
2682 __FUNCTION__);
2683 return -EINVAL;
2685 @@ -61,37 +61,37 @@ int init_network (void)
2686 if (bind (server_socket, (struct sockaddr *) &server, sizeof (server)))
2688 close (server_socket);
2689 - log (LOG_CRIT, "%s: Unable to bind socket. Terminating.\n",
2690 + do_log (LOG_CRIT, "%s: Unable to bind socket. Terminating.\n",
2691 __FUNCTION__);
2692 return -EINVAL;
2694 if (getsockname (server_socket, (struct sockaddr *) &server, &length))
2696 - log (LOG_CRIT, "%s: Unable to read socket name.Terminating.\n",
2697 + do_log (LOG_CRIT, "%s: Unable to read socket name.Terminating.\n",
2698 __FUNCTION__);
2699 return -EINVAL;
2701 #ifdef USE_KERNEL
2702 if (gconfig.forceuserspace)
2704 - log (LOG_LOG, "Not looking for kernel support.\n");
2705 + do_log (LOG_LOG, "Not looking for kernel support.\n");
2706 kernel_support = 0;
2708 else
2710 if (ioctl (server_socket, SIOCSETL2TP, NULL) < 0)
2712 - log (LOG_LOG, "L2TP kernel support not detected.\n");
2713 + do_log (LOG_LOG, "L2TP kernel support not detected.\n");
2714 kernel_support = 0;
2716 else
2718 - log (LOG_LOG, "Using l2tp kernel support.\n");
2719 + do_log (LOG_LOG, "Using l2tp kernel support.\n");
2720 kernel_support = -1;
2723 #else
2724 - log (LOG_LOG, "This binary does not support kernel L2TP.\n");
2725 + do_log (LOG_LOG, "This binary does not support kernel L2TP.\n");
2726 #endif
2727 arg = fcntl (server_socket, F_GETFL);
2728 arg |= O_NONBLOCK;
2729 @@ -154,11 +154,11 @@ void dethrottle (void *call)
2730 /* struct call *c = (struct call *)call; */
2731 /* if (c->throttle) {
2732 #ifdef DEBUG_FLOW
2733 - log(LOG_DEBUG, "%s: dethrottling call %d, and setting R-bit\n",__FUNCTION__,c->ourcid);
2734 + do_log(LOG_DEBUG, "%s: dethrottling call %d, and setting R-bit\n",__FUNCTION__,c->ourcid);
2735 #endif c->rbit = RBIT;
2736 c->throttle = 0;
2737 } else {
2738 - log(LOG_DEBUG, "%s: call %d already dethrottled?\n",__FUNCTION__,c->ourcid);
2739 + do_log(LOG_DEBUG, "%s: call %d already dethrottled?\n",__FUNCTION__,c->ourcid);
2740 } */
2743 @@ -170,7 +170,7 @@ void control_xmit (void *b)
2744 int ns;
2745 if (!buf)
2747 - log (LOG_WARN, "%s: called on NULL buffer!\n", __FUNCTION__);
2748 + do_log (LOG_WARN, "%s: called on NULL buffer!\n", __FUNCTION__);
2749 return;
2752 @@ -182,7 +182,7 @@ void control_xmit (void *b)
2753 if (ns < t->cLr)
2755 #ifdef DEBUG_CONTROL_XMIT
2756 - log (LOG_DEBUG, "%s: Tossing packet %d\n", __FUNCTION__, ns);
2757 + do_log (LOG_DEBUG, "%s: Tossing packet %d\n", __FUNCTION__, ns);
2758 #endif
2759 /* Okay, it's been received. Let's toss it now */
2760 toss (buf);
2761 @@ -199,7 +199,7 @@ void control_xmit (void *b)
2763 if (t->self->needclose)
2765 - log (LOG_DEBUG,
2766 + do_log (LOG_DEBUG,
2767 "%s: Unable to deliver closing message for tunnel %d. Destroying anyway.\n",
2768 __FUNCTION__, t->ourtid);
2769 t->self->needclose = 0;
2770 @@ -207,7 +207,7 @@ void control_xmit (void *b)
2772 else
2774 - log (LOG_DEBUG,
2775 + do_log (LOG_DEBUG,
2776 "%s: Maximum retries exceeded for tunnel %d. Closing.\n",
2777 __FUNCTION__, t->ourtid);
2778 strcpy (t->self->errormsg, "Timeout");
2779 @@ -226,7 +226,7 @@ void control_xmit (void *b)
2780 tv.tv_usec = 0;
2781 schedule (tv, control_xmit, buf);
2782 #ifdef DEBUG_CONTROL_XMIT
2783 - log (LOG_DEBUG, "%s: Scheduling and transmitting packet %d\n",
2784 + do_log (LOG_DEBUG, "%s: Scheduling and transmitting packet %d\n",
2785 __FUNCTION__, ns);
2786 #endif
2787 udp_xmit (buf);
2788 @@ -289,7 +289,7 @@ int build_fdset (fd_set *readfds)
2789 if (tun->self->needclose ^ tun->self->closing)
2791 if (debug_tunnel)
2792 - log (LOG_DEBUG, "%s: closing down tunnel %d\n",
2793 + do_log (LOG_DEBUG, "%s: closing down tunnel %d\n",
2794 __FUNCTION__, tun->ourtid);
2795 call_close (tun->self);
2796 /* Reset the while loop
2797 @@ -357,13 +357,13 @@ void network_thread ()
2798 if (recvsize < 0)
2800 if (errno != EAGAIN)
2801 - log (LOG_WARN,
2802 + do_log (LOG_WARN,
2803 "%s: recvfrom returned error %d (%s)\n",
2804 __FUNCTION__, errno, strerror (errno));
2806 else
2808 - log (LOG_WARN, "%s: received too small a packet\n",
2809 + do_log (LOG_WARN, "%s: received too small a packet\n",
2810 __FUNCTION__);
2813 @@ -372,7 +372,7 @@ void network_thread ()
2814 buf->len = recvsize;
2815 if (debug_network)
2817 - log (LOG_DEBUG, "%s: recv packet from %s, size = %d," \
2818 + do_log (LOG_DEBUG, "%s: recv packet from %s, size = %d," \
2819 "tunnel = %d, call = %d\n", __func__,
2820 inet_ntoa (from.sin_addr), recvsize,
2821 tunnel, call);
2822 @@ -401,13 +401,13 @@ void network_thread ()
2823 * to ack receiving the packet.
2825 if (debug_tunnel)
2826 - log (LOG_DEBUG,
2827 + do_log (LOG_DEBUG,
2828 "%s: no such call %d on tunnel %d. Sending special ZLB\n",
2829 __FUNCTION__);
2830 handle_special (buf, c, call);
2832 else
2833 - log (LOG_DEBUG,
2834 + do_log (LOG_DEBUG,
2835 "%s: unable to find call or tunnel to handle packet. call = %d, tunnel = %d Dumping.\n",
2836 __FUNCTION__, call, tunnel);
2838 @@ -420,7 +420,7 @@ void network_thread ()
2839 if (handle_packet (buf, c->container, c))
2841 if (debug_tunnel)
2842 - log (LOG_DEBUG, "%s: bad packet\n", __FUNCTION__);
2843 + do_log (LOG_DEBUG, "%s: bad packet\n", __FUNCTION__);
2845 if (c->cnu)
2847 @@ -444,12 +444,12 @@ void network_thread ()
2848 int result;
2849 recycle_payload (buf, sc->container->peer);
2850 #ifdef DEBUG_FLOW_MORE
2851 - log (LOG_DEBUG, "%s: rws = %d, pSs = %d, pLr = %d\n",
2852 + do_log (LOG_DEBUG, "%s: rws = %d, pSs = %d, pLr = %d\n",
2853 __FUNCTION__, sc->rws, sc->pSs, sc->pLr);
2854 #endif
2855 /* if ((sc->rws>0) && (sc->pSs > sc->pLr + sc->rws) && !sc->rbit) {
2856 #ifdef DEBUG_FLOW
2857 - log(LOG_DEBUG, "%s: throttling payload (call = %d, tunnel = %d, Lr = %d, Ss = %d, rws = %d)!\n",__FUNCTION__,
2858 + do_log(LOG_DEBUG, "%s: throttling payload (call = %d, tunnel = %d, Lr = %d, Ss = %d, rws = %d)!\n",__FUNCTION__,
2859 sc->cid, sc->container->tid, sc->pLr, sc->pSs, sc->rws);
2860 #endif
2861 sc->throttle = -1;
2862 @@ -485,7 +485,7 @@ void network_thread ()
2864 if (result != 0)
2866 - log (LOG_WARN,
2867 + do_log (LOG_WARN,
2868 "%s: tossing read packet, error = %s (%d). Closing call.\n",
2869 __FUNCTION__, strerror (-result), -result);
2870 strcpy (sc->errormsg, strerror (-result));
2871 diff -rdup l2tpd-0.70-pre20031121.oorig/pty.c l2tpd-0.70-pre20031121/pty.c
2872 --- l2tpd-0.70-pre20031121.oorig/pty.c 2004-07-08 22:47:52.000000000 +0200
2873 +++ l2tpd-0.70-pre20031121/pty.c 2006-12-28 16:41:59.000000000 +0100
2874 @@ -59,6 +59,6 @@ int getPtyMaster (char *tty10, char *tty
2878 - log (LOG_CRIT, "%s: No more free pseudo-tty's\n", __FUNCTION__);
2879 + do_log (LOG_CRIT, "%s: No more free pseudo-tty's\n", __FUNCTION__);
2880 return -1;
2882 diff -rdup l2tpd-0.70-pre20031121.oorig/scheduler.c l2tpd-0.70-pre20031121/scheduler.c
2883 --- l2tpd-0.70-pre20031121.oorig/scheduler.c 2004-07-08 22:47:52.000000000 +0200
2884 +++ l2tpd-0.70-pre20031121/scheduler.c 2006-12-28 16:41:59.000000000 +0100
2885 @@ -58,7 +58,7 @@ void alarm_handler (int signal)
2886 if (cnt != 1)
2888 /* Whoa, we got called from within ourselves! */
2889 - log (LOG_DEBUG, "%s : Whoa... cnt = %d\n", __FUNCTION__, cnt);
2890 + do_log (LOG_DEBUG, "%s : Whoa... cnt = %d\n", __FUNCTION__, cnt);
2891 return;
2893 while (events)
2894 @@ -91,7 +91,7 @@ void alarm_handler (int signal)
2896 if ((then.tv_sec <= 0) && (then.tv_usec <= 0))
2898 - log (LOG_WARN, "%s: Whoa... Scheduling for <=0 time???\n",
2899 + do_log (LOG_WARN, "%s: Whoa... Scheduling for <=0 time???\n",
2900 __FUNCTION__);
2902 else
2903 --- l2tpd-0.70-pre20031121.orig2/l2tpd.c 2007-10-13 17:49:02.000000000 +0200
2904 +++ l2tpd-0.70-pre20031121/l2tpd.c 2007-10-13 17:54:49.000000000 +0200
2905 @@ -354,7 +354,7 @@
2907 if (openpty(&pty_fd, &tty_fd, NULL, NULL, NULL) != 0)
2909 - log (LOG_WARN, "%s: unable to allocate pty/tty, abandoning!\n",
2910 + do_log (LOG_WARN, "%s: unable to allocate pty/tty, abandoning!\n",
2911 __FUNCTION__);
2912 return -EINVAL;