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");
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);
13 @@ -168,7 +168,7 @@ int get_secret (char *us, char *them, ch
19 "%s: Invalid authentication info (no us), line %d\n",
22 @@ -182,7 +182,7 @@ int get_secret (char *us, char *them, ch
28 "%s: Invalid authentication info (nothem), line %d\n",
31 @@ -195,7 +195,7 @@ int get_secret (char *us, char *them, ch
37 "%s: Invalid authentication info (no secret), line %d\n",
40 @@ -204,7 +204,7 @@ int get_secret (char *us, char *them, ch
41 (!strcasecmp (t, them) || !strcasecmp (t, "*")))
46 "%s: we are '%s', they are '%s', secret is '%s'\n",
47 __FUNCTION__, u, t, s);
49 @@ -223,12 +223,12 @@ int handle_challenge (struct tunnel *t,
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",
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__,
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);
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));
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);
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)))
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);
123 void encrypt_avp (struct buffer *buf, _u16 len, struct tunnel *t)
124 @@ -405,9 +405,9 @@ void encrypt_avp (struct buffer *buf, _u
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);
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];
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);
145 @@ -449,7 +449,7 @@ int decrypt_avp (char *buf, struct tunne
147 if (!t->chal_us.vector)
151 "decrypt_avp: Hidden bit set, but no random vector specified!\n");
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);
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: ");
166 @@ -498,7 +498,7 @@ int decrypt_avp (char *buf, struct tunne
167 len = ntohs (new_hdr->attr) + sizeof (struct avp_hdr);
172 "decrypt_avp: Decrypted length is too long (%d > %d)\n", len,
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))
184 "%s: attempting to negotiate tunnel inside a call!\n",
187 @@ -173,7 +173,7 @@ int validate_msgtype_avp(int attr, stru
193 "%s: attempting to negotiate SCCRQ with state != 0\n",
196 @@ -183,7 +183,7 @@ int validate_msgtype_avp(int attr, stru
197 if (t->state != SCCRQ)
202 "%s: attempting to negotiate SCCRP with state != SCCRQ!\n",
205 @@ -193,7 +193,7 @@ int validate_msgtype_avp(int attr, stru
206 if (t->state != SCCRP)
211 "%s: attempting to negotiate SCCCN with state != SCCRP!\n",
214 @@ -203,7 +203,7 @@ int validate_msgtype_avp(int attr, stru
215 if (t->state != SCCCN)
220 "%s: attempting to negotiate ICRQ when state != SCCCN\n",
223 @@ -211,7 +211,7 @@ int validate_msgtype_avp(int attr, stru
229 "%s: attempting to negotiate ICRQ on a call!\n",
232 @@ -221,7 +221,7 @@ int validate_msgtype_avp(int attr, stru
233 if (t->state != SCCCN)
238 "%s: attempting to negotiate ICRP on tunnel!=SCCCN\n",
241 @@ -229,7 +229,7 @@ int validate_msgtype_avp(int attr, stru
242 if (c->state != ICRQ)
247 "%s: attempting to negotiate ICRP when state != ICRQ\n",
250 @@ -239,7 +239,7 @@ int validate_msgtype_avp(int attr, stru
251 if (c->state != ICRP)
256 "%s: attempting to negotiate ICCN when state != ICRP\n",
259 @@ -249,7 +249,7 @@ int validate_msgtype_avp(int attr, stru
260 if (c->state != ICCN)
265 "%s: attempting to negotiate SLI when state != ICCN\n",
268 @@ -259,7 +259,7 @@ int validate_msgtype_avp(int attr, stru
269 if (t->state != SCCCN)
274 "%s: attempting to negotiate OCRP on tunnel!=SCCCN\n",
277 @@ -267,7 +267,7 @@ int validate_msgtype_avp(int attr, stru
278 if (c->state != OCRQ)
283 "%s: attempting to negotiate OCRP when state != OCRQ\n",
286 @@ -278,7 +278,7 @@ int validate_msgtype_avp(int attr, stru
287 if (c->state != OCRQ)
292 "%s: attempting to negotiate OCCN when state != OCRQ\n",
295 @@ -289,7 +289,7 @@ int validate_msgtype_avp(int attr, stru
299 - log (LOG_WARN, "%s: unknown messages type %d\n",
300 + do_log (LOG_WARN, "%s: unknown messages type %d\n",
304 @@ -332,7 +332,7 @@ int ignore_avp (struct tunnel *t, struct
308 - log (LOG_DEBUG, "%s : Ignoring AVP\n", __func__);
309 + do_log (LOG_DEBUG, "%s : Ignoring AVP\n", __func__);
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__,
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)
330 - log (LOG_DEBUG, "%s: new incoming call\n", __func__);
331 + do_log (LOG_DEBUG, "%s: new incoming call\n", __func__);
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__);
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);
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;
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)
353 - log (LOG_DEBUG, "%s: peer requires sequencing.\n", __func__);
354 + do_log (LOG_DEBUG, "%s: peer requires sequencing.\n", __func__);
358 @@ -411,7 +411,7 @@ int result_code_avp (struct tunnel *t, s
359 if ((c->msgtype == StopCCN) && ((result > 7) || (result < 1)))
364 "%s: (StopCCN) result code out of range ! (1 < %d < 7)\n",
367 @@ -420,7 +420,7 @@ int result_code_avp (struct tunnel *t, s
368 if ((c->msgtype == CDN) && ((result > 11) || (result < 1)))
373 "%s: (CDN) result code out of range !(1 < %d < 11)\n",
376 @@ -435,14 +435,14 @@ int result_code_avp (struct tunnel *t, s
378 if(c->msgtype == StopCCN)
382 "%s: peer closing for reason %d (%s), error = %d (%s)\n",
383 __func__, result, stopccn_result_codes[result], error,
390 "%s: peer closing for reason %d (%s), error = %d (%s)\n",
391 __func__, result, cdn_result_codes[result], error,
393 @@ -458,7 +458,7 @@ int protocol_version_avp (struct tunnel
394 u_int8_t *p = data + sizeof(struct avp_hdr);
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));
402 @@ -471,7 +471,7 @@ int framing_caps_avp (struct tunnel *t,
403 u_int16_t caps = get16(p + 2);
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);
415 - log (LOG_DEBUG, "%s: supported peer bearers:%s %s\n",
416 + do_log (LOG_DEBUG, "%s: supported peer bearers:%s %s\n",
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);
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);
429 @@ -517,7 +517,7 @@ int bearer_type_avp (struct tunnel *t, s
431 t->call_head->bearer = get16(p + 2);
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");
438 @@ -529,7 +529,7 @@ int frame_type_avp (struct tunnel *t, st
440 c->frame = get16(p + 2);
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");
447 @@ -544,7 +544,7 @@ int hostname_avp (struct tunnel *t, stru
448 t->hostname[datalen] = '\0';
451 - log (LOG_DEBUG, "%s: peer reports hostname '%s'\n", __func__,
452 + do_log (LOG_DEBUG, "%s: peer reports hostname '%s'\n", __func__,
456 @@ -561,7 +561,7 @@ int calling_number_avp (struct tunnel *t
457 t->call_head->dialing[datalen] = '\0';
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);
465 @@ -578,7 +578,7 @@ int called_number_avp (struct tunnel *t,
466 t->call_head->dialed[datalen] = '\0';
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);
474 @@ -595,7 +595,7 @@ int sub_address_avp (struct tunnel *t, s
475 t->call_head->subaddy[datalen] = '\0';
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);
483 @@ -610,7 +610,7 @@ int vendor_avp (struct tunnel *t, struct
484 t->vendor[datalen] = '\0';
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);
492 @@ -627,7 +627,7 @@ int challenge_avp (struct tunnel *t, str
493 t->chal_us.state = STATE_CHALLENGED;
496 - log (LOG_DEBUG, "%s: challenge avp found\n", __func__);
497 + do_log (LOG_DEBUG, "%s: challenge avp found\n", __func__);
501 @@ -639,7 +639,7 @@ int chalresp_avp (struct tunnel *t, stru
503 memcpy(t->chal_them.reply, p, MD_SIG_SIZE);
505 - log(LOG_DEBUG, "%s: Challenge reply found\n", __func__);
506 + do_log(LOG_DEBUG, "%s: Challenge reply found\n", __func__);
510 @@ -655,7 +655,7 @@ int assigned_tunnel_avp (struct tunnel *
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);
519 @@ -678,7 +678,7 @@ int assigned_session_avp (struct tunnel
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);
528 @@ -690,7 +690,7 @@ int packet_delay_avp (struct tunnel *t,
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__,
537 @@ -705,7 +705,7 @@ int call_serno_avp (struct tunnel *t, st
539 t->call_head->serno = get32(p);
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);
546 @@ -717,7 +717,7 @@ int rx_speed_avp (struct tunnel *t, stru
548 c->rxspeed = get32(p);
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);
555 @@ -728,7 +728,7 @@ int tx_speed_avp (struct tunnel *t, stru
557 c->txspeed = get32(p);
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);
564 @@ -741,7 +741,7 @@ int call_physchan_avp (struct tunnel *t,
566 t->call_head->physchan = get32(p);
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);
573 @@ -756,7 +756,7 @@ int receive_window_size_avp (struct tunn
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",
582 @@ -781,11 +781,11 @@ int handle_avps (struct buffer *buf, str
583 avp = (struct avp_hdr *) data;
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);
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");
596 @@ -800,7 +800,7 @@ int handle_avps (struct buffer *buf, str
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
611 "%s: handeled attribute %d.\n",
614 @@ -818,7 +818,7 @@ int handle_avps (struct buffer *buf, str
616 if (ALENGTH (rlen) > len)
620 "%s: AVP reported length > remaining packet length\n",
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");
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",
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",
648 set_error (c, VENDOR_ERROR, "First AVP must be message type");
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 " : "");
658 @@ -866,7 +866,7 @@ int handle_avps (struct buffer *buf, str
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))
671 - log (LOG_WARN, "%s: Unable to handle hidden %sAVP\n:",
672 + do_log (LOG_WARN, "%s: Unable to handle hidden %sAVP\n:",
674 (AMBIT (rlen) ? "mandatory " : ""));
676 @@ -899,7 +899,7 @@ int handle_avps (struct buffer *buf, str
677 if(avps[attr].validate(attr, t, c, avp, ALENGTH (rlen))) {
682 "%s: verification of AVP %d (%s) failed.\n",
684 avps[attr].description);
685 @@ -909,7 +909,7 @@ int handle_avps (struct buffer *buf, str
691 "%s: Bad exit status handling attribute %d (%s).\n",
693 avps[attr].description);
694 @@ -924,7 +924,7 @@ int handle_avps (struct buffer *buf, str
700 "%s: Bad exit status handling mandatory attribute %d (%s).\n",
702 avps[attr].description);
703 @@ -934,7 +934,7 @@ int handle_avps (struct buffer *buf, str
709 "%s: Bad exit status handling attribute %d (%s).\n",
711 avps[attr].description);
712 @@ -945,7 +945,7 @@ int handle_avps (struct buffer *buf, str
718 "%s: No handler for mandatory attribute %d (%s). Closing %s.\n",
720 avps[attr].description,
721 @@ -958,7 +958,7 @@ int handle_avps (struct buffer *buf, str
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",
728 avps[attr].description);
730 @@ -980,7 +980,7 @@ int handle_avps (struct buffer *buf, str
734 - log (LOG_WARN, "%s: negative overall packet length\n", __func__);
735 + do_log (LOG_WARN, "%s: negative overall packet length\n", __func__);
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);
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
758 - log (LOG_DEBUG, "%s: Error %d (%s)\n", __FUNCTION__, errno,
759 + do_log (LOG_DEBUG, "%s: Error %d (%s)\n", __FUNCTION__, errno,
765 "%s: Too many errors. Declaring call dead.\n",
768 @@ -154,7 +154,7 @@ int read_packet (struct buffer *buf, int
772 - log (LOG_DEBUG, "%s: got an escaped PPP_FLAG\n",
773 + do_log (LOG_DEBUG, "%s: got an escaped PPP_FLAG\n",
777 @@ -190,12 +190,12 @@ int read_packet (struct buffer *buf, int
781 - log (LOG_WARN, "%s: read overrun\n", __FUNCTION__);
782 + do_log (LOG_WARN, "%s: read overrun\n", __FUNCTION__);
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__);
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",
801 @@ -231,7 +231,7 @@ void call_close (struct call *c)
802 || ((struct tunnel *) se->data == c->container))
805 - log (LOG_DEBUG, "%s: Descheduling event\n", __FUNCTION__);
806 + do_log (LOG_DEBUG, "%s: Descheduling event\n", __FUNCTION__);
810 @@ -262,7 +262,7 @@ void call_close (struct call *c)
811 /* Really close this tunnel, as our
812 StopCCN has been ack'd */
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);
819 @@ -298,7 +298,7 @@ void call_close (struct call *c)
821 do_packet_dump (buf);
823 - log (LOG_DEBUG, "%s: enqueing close message for tunnel\n",
824 + do_log (LOG_DEBUG, "%s: enqueing close message for tunnel\n",
828 @@ -315,7 +315,7 @@ void call_close (struct call *c)
834 "%s : Connection %d closed to %s, port %d (%s)\n", __FUNCTION__,
836 IPADDY (c->container->peer.sin_addr),
837 @@ -335,7 +335,7 @@ void call_close (struct call *c)
841 - log (LOG_DEBUG, "%s: Actually closing call %d\n", __FUNCTION__,
842 + do_log (LOG_DEBUG, "%s: Actually closing call %d\n", __FUNCTION__,
846 @@ -375,11 +375,11 @@ void call_close (struct call *c)
848 do_packet_dump (buf);
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);
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)
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__,
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;
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);
878 @@ -608,7 +608,7 @@ struct call *get_call (int tunnel, int c
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);
887 @@ -619,7 +619,7 @@ struct call *get_call (int tunnel, int c
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);
896 @@ -632,7 +632,7 @@ struct call *get_call (int tunnel, int c
902 "%s: call ID specified, but no tunnel ID specified. tossing.\n",
905 @@ -643,13 +643,13 @@ struct call *get_call (int tunnel, int c
911 "%s: allocating new tunnel for host %s, port %d.\n",
912 __FUNCTION__, IPADDY (addr), ntohs (port));
914 if (!(st = new_tunnel ()))
918 "%s: unable to allocate new tunnel for host %s, port %d.\n",
919 __FUNCTION__, IPADDY (addr), ntohs (port));
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)
926 do_packet_dump (buf);
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);
933 * Schedule another Hello in a little bit.
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__,
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--;
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__,
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 */
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",
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);
965 @@ -247,7 +247,7 @@ int control_finish (struct tunnel *t, st
967 do_packet_dump (buf);
969 - log (LOG_DEBUG, "%s: control_finish: sending SCCRQ\n",
970 + do_log (LOG_DEBUG, "%s: control_finish: sending SCCRQ\n",
974 @@ -289,7 +289,7 @@ int control_finish (struct tunnel *t, st
976 do_packet_dump (buf);
978 - log (LOG_DEBUG, "%s: sending ICRQ\n", __FUNCTION__);
979 + do_log (LOG_DEBUG, "%s: sending ICRQ\n", __FUNCTION__);
983 @@ -342,7 +342,7 @@ int control_finish (struct tunnel *t, st
989 "%s: Peer did not specify assigned tunnel ID. Closing.\n",
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)))
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
1006 + do_log (LOG_DEBUG,
1007 "%s: Peer did not specify framing capability. Closing.\n",
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
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");
1019 @@ -382,7 +382,7 @@ int control_finish (struct tunnel *t, st
1020 if ((!strlen (t->hostname)) && ((t->chal_us.state) || ((t->lns->challenge))))
1024 + do_log (LOG_DEBUG,
1025 "%s: Peer did not specify hostname. Closing.\n",
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
1033 + do_log (LOG_DEBUG,
1034 "%s: Peer requested tunnel %d twice, ignoring second one.\n",
1035 __FUNCTION__, t->tid);
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");
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__,
1053 set_error (c, VENDOR_ERROR, "No secret on our side");
1055 @@ -461,7 +461,7 @@ int control_finish (struct tunnel *t, st
1056 do_packet_dump (buf);
1059 - log (LOG_DEBUG, "%s: sending SCCRP\n", __FUNCTION__);
1060 + do_log (LOG_DEBUG, "%s: sending SCCRP\n", __FUNCTION__);
1064 @@ -472,7 +472,7 @@ int control_finish (struct tunnel *t, st
1069 + do_log (LOG_DEBUG,
1070 "%s: Peer did not specify framing capability. Closing.\n",
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
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");
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))))
1087 + do_log (LOG_DEBUG,
1088 "%s: Peer did not specify hostname. Closing.\n",
1090 set_error (c, VENDOR_ERROR, "Specify your hostname");
1091 @@ -501,7 +501,7 @@ int control_finish (struct tunnel *t, st
1096 + do_log (LOG_DEBUG,
1097 "%s: Peer did not specify assigned tunnel ID. Closing.\n",
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);
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);
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");
1127 @@ -563,17 +563,17 @@ int control_finish (struct tunnel *t, st
1128 do_packet_dump (buf);
1131 - log (LOG_DEBUG, "%s: sending SCCCN\n", __FUNCTION__);
1132 + do_log (LOG_DEBUG, "%s: sending SCCCN\n", __FUNCTION__);
1134 /* Schedule a HELLO */
1135 tv.tv_sec = HELLO_DELAY;
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__,
1142 t->hello = schedule (tv, hello, (void *) t);
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);
1157 @@ -608,7 +608,7 @@ int control_finish (struct tunnel *t, st
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;
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__,
1174 t->hello = schedule (tv, hello, (void *) t);
1175 @@ -625,7 +625,7 @@ int control_finish (struct tunnel *t, st
1180 + do_log (LOG_DEBUG,
1181 "%s: Peer tried to disconnect without specifying tunnel ID\n",
1184 @@ -633,7 +633,7 @@ int control_finish (struct tunnel *t, st
1185 if ((t->qtid != t->tid) && (t->tid > 0))
1189 + do_log (LOG_DEBUG,
1190 "%s: Peer tried to disconnect with invalid TID (%d != %d)\n",
1191 __FUNCTION__, t->qtid, t->tid);
1193 @@ -644,12 +644,12 @@ int control_finish (struct tunnel *t, st
1194 if (t->self->result < 0)
1198 + do_log (LOG_DEBUG,
1199 "%s: Peer tried to disconnect without specifying result code.\n",
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
1213 + do_log (LOG_DEBUG,
1214 "%s: Peer tried to initiate call without call ID\n",
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 */
1222 + do_log (LOG_DEBUG,
1223 "%s: Peer requested call %d twice, ignoring second one.\n",
1224 __FUNCTION__, p->cid);
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__);
1235 @@ -713,7 +713,7 @@ int control_finish (struct tunnel *t, st
1237 set_error (p, ERROR_NORES, "No available IP address");
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);
1244 @@ -745,14 +745,14 @@ int control_finish (struct tunnel *t, st
1245 do_packet_dump (buf);
1248 - log (LOG_DEBUG, "%s: Sending ICRP\n", __FUNCTION__);
1249 + do_log (LOG_DEBUG, "%s: Sending ICRP\n", __FUNCTION__);
1257 + do_log (LOG_DEBUG,
1258 "%s: Peer tried to negotiate ICRP without specifying call ID\n",
1261 @@ -800,8 +800,8 @@ int control_finish (struct tunnel *t, st
1265 - log (LOG_DEBUG, "%s: Sending ICCN\n", __FUNCTION__);
1267 + do_log (LOG_DEBUG, "%s: Sending ICCN\n", __FUNCTION__);
1269 "%s: Call established with %s, Local: %d, Remote: %d, Serial: %d\n",
1270 __FUNCTION__, IPADDY (t->peer.sin_addr), c->ourcid, c->cid,
1272 @@ -860,21 +860,21 @@ int control_finish (struct tunnel *t, st
1277 + do_log (LOG_DEBUG,
1278 "%s: Peer attempted ICCN on the actual tunnel, not the call",
1285 + do_log (LOG_DEBUG,
1286 "%s: Peer did not specify transmit speed\n", __FUNCTION__);
1293 + do_log (LOG_DEBUG,
1294 "%s: Peer did not specify framing type\n", __FUNCTION__);
1297 @@ -938,7 +938,7 @@ int control_finish (struct tunnel *t, st
1303 "%s: Call established with %s, Local: %d, Remote: %d, Serial: %d\n",
1304 __FUNCTION__, IPADDY (t->peer.sin_addr), c->ourcid, c->cid,
1306 @@ -996,7 +996,7 @@ int control_finish (struct tunnel *t, st
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 */
1315 @@ -1008,7 +1008,7 @@ int control_finish (struct tunnel *t, st
1320 + do_log (LOG_DEBUG,
1321 "%s: Peer tried to disconnect without specifying call ID\n",
1324 @@ -1021,7 +1021,7 @@ int control_finish (struct tunnel *t, st
1329 + do_log (LOG_DEBUG,
1330 "%s: Unable to determine call to be disconnected.\n",
1333 @@ -1032,7 +1032,7 @@ int control_finish (struct tunnel *t, st
1334 if ((c->qcid != p->cid) && p->cid > 0)
1338 + do_log (LOG_DEBUG,
1339 "%s: Peer tried to disconnect with invalid CID (%d != %d)\n",
1340 __FUNCTION__, c->qcid, c->cid);
1342 @@ -1041,12 +1041,12 @@ int control_finish (struct tunnel *t, st
1347 + do_log (LOG_DEBUG,
1348 "%s: Peer tried to disconnect without specifying result code.\n",
1354 "%s: Connection closed to %s, serial %d (%s)\n", __FUNCTION__,
1355 IPADDY (t->peer.sin_addr), c->serno, c->errormsg);
1357 @@ -1057,7 +1057,7 @@ int control_finish (struct tunnel *t, st
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
1371 + do_log (LOG_DEBUG,
1372 "%s: Received too small of packet\n", __FUNCTION__);
1375 @@ -1088,7 +1088,7 @@ inline int check_control (const struct b
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);
1392 if (h->Ns != t->control_rec_seq_num)
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
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",
1408 zlb = new_outgoing (t);
1409 @@ -1153,7 +1153,7 @@ inline int check_control (const struct b
1413 - log (LOG_DEBUG, "%s: Control bit not set\n", __FUNCTION__);
1414 + do_log (LOG_DEBUG, "%s: Control bit not set\n", __FUNCTION__);
1418 @@ -1161,7 +1161,7 @@ inline int check_control (const struct b
1422 - log (LOG_DEBUG, "%s: Length bit not set\n", __FUNCTION__);
1423 + do_log (LOG_DEBUG, "%s: Length bit not set\n", __FUNCTION__);
1427 @@ -1169,7 +1169,7 @@ inline int check_control (const struct b
1431 - log (LOG_DEBUG, "%s: Flow bit not set\n", __FUNCTION__);
1432 + do_log (LOG_DEBUG, "%s: Flow bit not set\n", __FUNCTION__);
1436 @@ -1179,17 +1179,17 @@ inline int check_control (const struct b
1438 if (CVER (h->ver) == VER_PPTP)
1441 + do_log (LOG_DEBUG,
1442 "%s: PPTP packet received\n", __FUNCTION__);
1444 else if (CVER (h->ver) < VER_L2TP)
1447 + do_log (LOG_DEBUG,
1448 "%s: L2F packet received\n", __FUNCTION__);
1453 + do_log (LOG_DEBUG,
1454 "%s: Unknown version received\n", __FUNCTION__);
1457 @@ -1215,7 +1215,7 @@ inline int check_payload (struct buffer
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",
1466 @@ -1226,7 +1226,7 @@ inline int check_payload (struct buffer
1467 no matter what. we'll look more later */
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__);
1475 @@ -1237,7 +1237,7 @@ inline int check_payload (struct buffer
1479 - log (LOG_DEBUG, "%s Control bit set\n", __FUNCTION__);
1480 + do_log (LOG_DEBUG, "%s Control bit set\n", __FUNCTION__);
1484 @@ -1247,7 +1247,7 @@ inline int check_payload (struct buffer
1486 /* if (!c->fbit && !c->ourfbit) {
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__);
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) {
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__);
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",
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",
1518 - log (LOG_DEBUG, "%s: Unknown version received\n",
1519 + do_log (LOG_DEBUG, "%s: Unknown version received\n",
1523 @@ -1289,7 +1289,7 @@ inline int check_payload (struct buffer
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);
1532 @@ -1298,7 +1298,7 @@ inline int check_payload (struct buffer
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);
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",
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__);
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);
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);
1569 if (new_hdr->Ns != c->data_seq_num)
1570 @@ -1410,7 +1410,7 @@ inline int expand_payload (struct buffer
1575 + do_log (LOG_DEBUG,
1576 "%s: Already seen this packet before (%d < %d)\n",
1577 __FUNCTION__, new_hdr->Ns, c->pSr);
1579 @@ -1421,7 +1421,7 @@ inline int expand_payload (struct buffer
1580 /* FIXME: I should buffer for out of order packets */
1584 + do_log (LOG_DEBUG,
1585 "%s: Oops, lost a packet or two (%d != %d). continuing...\n",
1586 __FUNCTION__, new_hdr->Ns, c->pSr);
1588 @@ -1431,7 +1431,7 @@ inline int expand_payload (struct buffer
1593 + do_log (LOG_DEBUG,
1594 "%s: Received out of order payload packet (%d != %d)\n",
1595 __FUNCTION__, new_hdr->Ns, c->pSr);
1597 @@ -1464,13 +1464,13 @@ void send_zlb (void *data)
1598 c = (struct call *) data;
1601 - log (LOG_WARN, "%s: called on NULL call\n", __FUNCTION__);
1602 + do_log (LOG_WARN, "%s: called on NULL call\n", __FUNCTION__);
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",
1613 @@ -1481,7 +1481,7 @@ void send_zlb (void *data)
1614 c->data_seq_num--; /* We don't increment on ZLB's */
1617 - log (LOG_DEBUG, "%s: sending payload ZLB\n", __FUNCTION__);
1618 + do_log (LOG_DEBUG, "%s: sending payload ZLB\n", __FUNCTION__);
1622 @@ -1503,7 +1503,7 @@ inline int write_packet (struct buffer *
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__);
1631 @@ -1530,7 +1530,7 @@ inline int write_packet (struct buffer *
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",
1640 @@ -1542,19 +1542,19 @@ inline int write_packet (struct buffer *
1644 - log (LOG_WARN, "%s: async write failed: %s\n", __FUNCTION__,
1645 + do_log (LOG_WARN, "%s: async write failed: %s\n", __FUNCTION__,
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__,
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",
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)) {
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);
1672 @@ -1599,7 +1599,7 @@ inline int write_packet (struct buffer *
1673 * everything ended normally
1676 - log (LOG_WARN, "%s: %s(%d)\n", __FUNCTION__, strerror (errno),
1677 + do_log (LOG_WARN, "%s: %s(%d)\n", __FUNCTION__, strerror (errno),
1681 @@ -1633,7 +1633,7 @@ void handle_special (struct buffer *buf,
1683 /* If it's a ZLB, we ignore it */
1685 - log (LOG_DEBUG, "%s: ZLB for closed call\n", __FUNCTION__);
1686 + do_log (LOG_DEBUG, "%s: ZLB for closed call\n", __FUNCTION__);
1690 @@ -1649,7 +1649,7 @@ void handle_special (struct buffer *buf,
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))
1703 - log (LOG_DEBUG, "%s: control ZLB received\n", __FUNCTION__);
1704 + do_log (LOG_DEBUG, "%s: control ZLB received\n", __FUNCTION__);
1706 t->control_rec_seq_num--;
1708 @@ -1676,7 +1676,7 @@ inline int handle_packet (struct buffer
1709 if (c->container->cLr >= c->closeSs)
1712 - log (LOG_DEBUG, "%s: ZLB for closing message found\n",
1713 + do_log (LOG_DEBUG, "%s: ZLB for closing message found\n",
1717 @@ -1692,13 +1692,13 @@ inline int handle_packet (struct buffer
1721 - log (LOG_DEBUG, "%s: bad AVP handling!\n", __FUNCTION__);
1722 + do_log (LOG_DEBUG, "%s: bad AVP handling!\n", __FUNCTION__);
1728 - log (LOG_DEBUG, "%s: bad control packet!\n", __FUNCTION__);
1729 + do_log (LOG_DEBUG, "%s: bad control packet!\n", __FUNCTION__);
1733 @@ -1713,11 +1713,11 @@ inline int handle_packet (struct buffer
1734 /* if (c->throttle) {
1735 if (c->pSs > c->pLr + c->rws) {
1737 - log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1738 + do_log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1742 - log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1743 + do_log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1745 if (c->dethrottle) deschedule(c->dethrottle);
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!
1751 - log(LOG_DEBUG, "%s: Sending immediate ZLB!\n",__FUNCTION__);
1752 + do_log(LOG_DEBUG, "%s: Sending immediate ZLB!\n",__FUNCTION__);
1755 Deschedule any existing zlb_xmit's
1756 @@ -1756,7 +1756,7 @@ inline int handle_packet (struct buffer
1758 deschedule(c->zlb_xmit);
1760 - log(LOG_DEBUG, "%s: scheduling ZLB\n",__FUNCTION__);
1761 + do_log(LOG_DEBUG, "%s: scheduling ZLB\n",__FUNCTION__);
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))
1769 - log (LOG_DEBUG, "%s: payload ZLB received\n",
1770 + do_log (LOG_DEBUG, "%s: payload ZLB received\n",
1773 /* if (c->throttle) {
1774 if (c->pSs > c->pLr + c->rws) {
1776 - log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1777 + do_log(LOG_DEBUG, "%s: not yet dethrottling call\n",__FUNCTION__);
1781 - log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1782 + do_log(LOG_DEBUG, "%s: dethrottling call\n",__FUNCTION__);
1785 deschedule(c->dethrottle);
1786 @@ -1789,21 +1789,21 @@ inline int handle_packet (struct buffer
1790 - log (LOG_DEBUG, "%s: payload too small!\n", __FUNCTION__);
1791 + do_log (LOG_DEBUG, "%s: payload too small!\n", __FUNCTION__);
1798 - log (LOG_DEBUG, "%s: unable to expand payload!\n",
1799 + do_log (LOG_DEBUG, "%s: unable to expand payload!\n",
1806 - log (LOG_DEBUG, "%s: invalid payload packet!\n", __FUNCTION__);
1807 + do_log (LOG_DEBUG, "%s: invalid payload packet!\n", __FUNCTION__);
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 ()
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);
1823 @@ -77,7 +77,7 @@ struct lns *new_lns ()
1824 tmp = (struct lns *) malloc (sizeof (struct lns));
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",
1832 @@ -121,7 +121,7 @@ struct lac *new_lac ()
1833 tmp = (struct lac *) malloc (sizeof (struct lac));
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",
1841 @@ -174,7 +174,7 @@ int set_boolean (char *word, char *value
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);
1848 if ((val = yesno (value)) < 0)
1850 @@ -190,7 +190,7 @@ int set_int (char *word, char *value, in
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);
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)
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);
1866 strncpy (ptr, value, len);
1868 @@ -216,7 +216,7 @@ int set_port (char *word, char *value, i
1870 case CONTEXT_GLOBAL:
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",
1876 set_int (word, value, &(((struct global *) item)->port));
1877 @@ -241,7 +241,7 @@ int set_rtimeout (char *word, char *valu
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",
1885 set_int (word, value, &(((struct lac *) item)->rtimeout));
1886 @@ -311,7 +311,7 @@ int set_rmax (char *word, char *value, i
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);
1893 set_int (word, value, &(((struct lac *) item)->rmax));
1895 @@ -335,7 +335,7 @@ int set_authfile (char *word, char *valu
1897 case CONTEXT_GLOBAL:
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",
1903 strncpy (((struct global *) item)->authfile, value,
1904 @@ -766,7 +766,7 @@ int set_iprange (char *word, char *value
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);
1913 @@ -788,7 +788,7 @@ int set_lac (char *word, char *value, in
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);
1922 @@ -830,7 +830,7 @@ int set_listenaddr (char *word, char *va
1924 case CONTEXT_GLOBAL:
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",
1930 if (set_ip (word, value, &(((struct global *) item)->listenaddr)))
1931 @@ -890,7 +890,7 @@ int set_lns (char *word, char *value, in
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);
1938 l = (struct lac *) item;
1939 d = strchr (value, ':');
1940 @@ -934,7 +934,7 @@ int set_lns (char *word, char *value, in
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"
1947 rand_source = RAND_SYS;
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;
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);
1967 @@ -1000,7 +1000,7 @@ int set_rand_source (char *word, char *v
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);
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",
1985 @@ -1066,7 +1066,7 @@ int parse_config (FILE * f)
1987 context = CONTEXT_GLOBAL;
1990 + do_log (LOG_DEBUG,
1991 "parse_config: global context descriptor %s\n",
1994 @@ -1111,7 +1111,7 @@ int parse_config (FILE * f)
1995 strncpy (((struct lns *) data)->entname,
1996 d, sizeof (((struct lns *) data)->entname));
1998 - log (LOG_DEBUG, "parse_config: lns context descriptor %s\n",
1999 + do_log (LOG_DEBUG, "parse_config: lns context descriptor %s\n",
2003 @@ -1154,13 +1154,13 @@ int parse_config (FILE * f)
2004 strncpy (((struct lac *) data)->entname,
2005 d, sizeof (((struct lac *) data)->entname));
2007 - log (LOG_DEBUG, "parse_config: lac context descriptor %s\n",
2008 + do_log (LOG_DEBUG, "parse_config: lac context descriptor %s\n",
2016 "parse_config: line %d: unknown context '%s'\n", linenum,
2019 @@ -1170,14 +1170,14 @@ int parse_config (FILE * f)
2025 "parse_config: line %d: data '%s' occurs with no context\n",
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",
2036 @@ -1191,7 +1191,7 @@ int parse_config (FILE * f)
2037 while (*t && (*t < 33))
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);
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,
2054 @@ -1209,7 +1209,7 @@ int parse_config (FILE * f)
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",
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)
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");
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,
2102 - log (LOG_WARN, "%d: Unknown event\n", s);
2103 + do_log (LOG_WARN, "%d: Unknown event\n", s);
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);
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"
2117 (t->lac ? t->lac->entname : (t->lns ? t->lns->entname : "")),
2118 @@ -117,7 +117,7 @@ void show_status (void)
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)
2131 - log (LOG_WARN, "==========Config File===========\n");
2132 + do_log (LOG_WARN, "==========Config File===========\n");
2136 - log (LOG_WARN, "LNS entry %s\n",
2137 + do_log (LOG_WARN, "LNS entry %s\n",
2138 tlns->entname[0] ? tlns->entname : "(unnamed)");
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)");
2152 - log (LOG_WARN, " %s", h->hostname);
2153 + do_log (LOG_WARN, " %s", h->hostname);
2158 - log (LOG_WARN, " [none]");
2159 - log (LOG_WARN, "\n");
2160 + do_log (LOG_WARN, " [none]");
2161 + do_log (LOG_WARN, "\n");
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 ) );
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__,
2190 @@ -245,7 +245,7 @@ void death_handler (int signal)
2192 struct tunnel *st, *st2;
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);
2199 @@ -300,12 +300,12 @@ int start_pppd (struct call *c, struct p
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__);
2209 - log (LOG_WARN, "%s: file descriptor already assigned!\n",
2210 + do_log (LOG_WARN, "%s: file descriptor already assigned!\n",
2214 @@ -326,7 +326,7 @@ int start_pppd (struct call *c, struct p
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",
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);
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
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");
2249 - log (LOG_WARN, "%s: unable to fork(), abandoning!\n", __FUNCTION__);
2250 + do_log (LOG_WARN, "%s: unable to fork(), abandoning!\n", __FUNCTION__);
2254 @@ -380,7 +380,7 @@ int start_pppd (struct call *c, struct p
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",
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);
2272 @@ -481,14 +481,14 @@ void destroy_tunnel (struct tunnel *t)
2278 "%s: unable to locate tunnel in tunnel list\n",
2284 - log (LOG_WARN, "%s: tunnel list is empty!\n", __FUNCTION__);
2285 + do_log (LOG_WARN, "%s: tunnel list is empty!\n", __FUNCTION__);
2289 @@ -497,7 +497,7 @@ void destroy_tunnel (struct tunnel *t)
2290 if (t->lac->redial && (t->lac->rtimeout > 0) && !t->lac->rsched &&
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__,
2296 tv.tv_sec = t->lac->rtimeout;
2298 @@ -527,7 +527,7 @@ struct tunnel *l2tp_call (char *host, in
2299 hp = gethostbyname (host);
2302 - log (LOG_WARN, "%s: gethostbyname() failed for %s.\n", __FUNCTION__,
2303 + do_log (LOG_WARN, "%s: gethostbyname() failed for %s.\n", __FUNCTION__,
2307 @@ -540,7 +540,7 @@ struct tunnel *l2tp_call (char *host, in
2308 tmp = get_call (0, 0, addr, port);
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__,
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,
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;
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",
2334 @@ -585,7 +585,7 @@ void magic_lac_tunnel (void *data)
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);
2343 @@ -602,7 +602,7 @@ struct call *lac_call (int tid, struct l
2347 - log (LOG_WARN, "%s: unable to create new call\n",
2348 + do_log (LOG_WARN, "%s: unable to create new call\n",
2352 @@ -614,14 +614,14 @@ struct call *lac_call (int tid, struct l
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);
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__,
2369 @@ -633,25 +633,25 @@ void magic_lac_dial (void *data)
2373 - log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__);
2374 + do_log (LOG_WARN, "%s : called on NULL lac!\n", __FUNCTION__);
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);
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__);
2394 - log (LOG_DEBUG, "%s : tunnel not up! Connecting!\n", __FUNCTION__);
2395 + do_log (LOG_DEBUG, "%s : tunnel not up! Connecting!\n", __FUNCTION__);
2397 magic_lac_tunnel (lac);
2399 @@ -670,7 +670,7 @@ void lac_hangup (int cid)
2401 if (tmp->ourcid == cid)
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)
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);
2417 @@ -693,7 +693,7 @@ void lac_disconnect (int tid)
2419 if (t->ourtid == tid)
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)
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);
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);
2444 @@ -797,7 +797,7 @@ void do_control ()
2445 if (buf[cnt - 1] == '\n')
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);
2453 @@ -808,7 +808,7 @@ void do_control ()
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);
2461 l2tp_call (host, UDP_LISTEN_PORT, NULL, NULL);
2462 @@ -840,7 +840,7 @@ void do_control ()
2464 magic_lac_dial (lac);
2467 + do_log (LOG_DEBUG,
2468 "%s: Session '%s' already active!\n",
2469 __FUNCTION__, lac->entname);
2471 @@ -852,12 +852,12 @@ void do_control ()
2472 tunl = atoi (tunstr);
2475 - log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
2476 + do_log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
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);
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__,
2495 @@ -891,7 +891,7 @@ void do_control ()
2497 lac_disconnect (lac->t->ourtid);
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);
2504 @@ -902,12 +902,12 @@ void do_control ()
2505 tunl = atoi (tunstr);
2508 - log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
2509 + do_log (LOG_DEBUG, "%s: No such tunnel '%s'\n", __FUNCTION__,
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);
2518 lac_disconnect (tunl);
2519 @@ -916,7 +916,7 @@ void do_control ()
2523 - log (LOG_DEBUG, "%s: Unknown command %c\n", __FUNCTION__,
2524 + do_log (LOG_DEBUG, "%s: Unknown command %c\n", __FUNCTION__,
2528 @@ -990,7 +990,7 @@ void daemonize() {
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);
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",
2544 close(server_socket);
2546 @@ -1035,7 +1035,7 @@ void daemonize() {
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);
2555 @@ -1054,12 +1054,12 @@ void init (int argc,char *argv[])
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__);
2565 - log (LOG_CRIT, "%s : Unable to determine host system\n",
2566 + do_log (LOG_CRIT, "%s : Unable to determine host system\n",
2570 @@ -1078,14 +1078,14 @@ void init (int argc,char *argv[])
2571 control_fd = open (CONTROL_PIPE, O_RDONLY | O_NONBLOCK, 0600);
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.",
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);
2588 @@ -1093,7 +1093,7 @@ void init (int argc,char *argv[])
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)");
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
2604 -void log (int level, const char *fmt, ...)
2605 +void do_log (int level, const char *fmt, ...)
2609 @@ -101,7 +101,7 @@ void bufferDump (char *buf, int buflen)
2610 c++; /* again two characters to display ONE byte */
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__,
2618 @@ -117,7 +117,7 @@ void bufferDump (char *buf, int buflen)
2622 - log (LOG_WARN, "%s: buffer[%d]: *%s*\n", __FUNCTION__, i,
2623 + do_log (LOG_WARN, "%s: buffer[%d]: *%s*\n", __FUNCTION__, i,
2627 @@ -201,7 +201,7 @@ struct ppp_opts *add_opt (struct ppp_opt
2628 new = (struct ppp_opts *) malloc (sizeof (struct ppp_opts));
2633 "%s : Unable to allocate ppp option memory. Expect a crash\n",
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",
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",
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);
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",
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",
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",
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");
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");
2718 - log (LOG_LOG, "Using l2tp kernel support.\n");
2719 + do_log (LOG_LOG, "Using l2tp kernel support.\n");
2720 kernel_support = -1;
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");
2727 arg = fcntl (server_socket, F_GETFL);
2729 @@ -154,11 +154,11 @@ void dethrottle (void *call)
2730 /* struct call *c = (struct call *)call; */
2731 /* if (c->throttle) {
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;
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);
2743 @@ -170,7 +170,7 @@ void control_xmit (void *b)
2747 - log (LOG_WARN, "%s: called on NULL buffer!\n", __FUNCTION__);
2748 + do_log (LOG_WARN, "%s: called on NULL buffer!\n", __FUNCTION__);
2752 @@ -182,7 +182,7 @@ void control_xmit (void *b)
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);
2759 /* Okay, it's been received. Let's toss it now */
2761 @@ -199,7 +199,7 @@ void control_xmit (void *b)
2763 if (t->self->needclose)
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)
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)
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",
2788 @@ -289,7 +289,7 @@ int build_fdset (fd_set *readfds)
2789 if (tun->self->needclose ^ tun->self->closing)
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 ()
2800 if (errno != EAGAIN)
2803 "%s: recvfrom returned error %d (%s)\n",
2804 __FUNCTION__, errno, strerror (errno));
2808 - log (LOG_WARN, "%s: received too small a packet\n",
2809 + do_log (LOG_WARN, "%s: received too small a packet\n",
2813 @@ -372,7 +372,7 @@ void network_thread ()
2814 buf->len = recvsize;
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,
2822 @@ -401,13 +401,13 @@ void network_thread ()
2823 * to ack receiving the packet.
2827 + do_log (LOG_DEBUG,
2828 "%s: no such call %d on tunnel %d. Sending special ZLB\n",
2830 handle_special (buf, c, call);
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))
2842 - log (LOG_DEBUG, "%s: bad packet\n", __FUNCTION__);
2843 + do_log (LOG_DEBUG, "%s: bad packet\n", __FUNCTION__);
2847 @@ -444,12 +444,12 @@ void network_thread ()
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);
2855 /* if ((sc->rws>0) && (sc->pSs > sc->pLr + sc->rws) && !sc->rbit) {
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);
2862 @@ -485,7 +485,7 @@ void network_thread ()
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__);
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)
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);
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",
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
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",