pptpgre-use-debug-option.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. diff -Nur pptpd-1.3.0/pptpgre.c.orig pptpd-1.3.0/pptpgre.c
  2. --- pptpd-1.3.0.orig/pptpgre.c 2005-08-02 13:33:31.000000000 +0200
  3. +++ pptpd-1.3.0/pptpgre.c 2008-10-14 13:30:20.000000000 +0200
  4. @@ -46,6 +46,9 @@
  5. #define PACKET_MAX 8196
  6. +/* Command Line Variable Args */
  7. +extern int pptpctrl_debug;
  8. +
  9. typedef int (*callback_t)(int cl, void *pack, unsigned int len);
  10. /* test for a 32 bit counter overflow */
  11. @@ -319,7 +322,9 @@ static int dequeue_gre (callback_t callb
  12. stats.rx_lost += head->seq - gre.seq_recv - 1;
  13. syslog(LOG_DEBUG, "GRE: timeout waiting for %d packets", head->seq - gre.seq_recv - 1);
  14. }
  15. - syslog(LOG_DEBUG, "GRE: accepting #%d from queue", head->seq);
  16. + if (pptpctrl_debug) {
  17. + syslog(LOG_DEBUG, "GRE: accepting #%d from queue", head->seq);
  18. + }
  19. gre.seq_recv = head->seq;
  20. status = callback(cl, head->packet, head->packlen);
  21. pqueue_del(head);
  22. @@ -399,7 +404,9 @@ int decaps_gre(int fd, int (*cb) (int cl
  23. }
  24. /* check for out-of-order sequence number */
  25. if (seq_greater(seq, gre.seq_recv)) {
  26. - syslog(LOG_DEBUG, "GRE: accepting packet #%d", seq);
  27. + if (pptpctrl_debug) {
  28. + syslog(LOG_DEBUG, "GRE: accepting packet #%d", seq);
  29. + }
  30. stats.rx_accepted++;
  31. gre.seq_recv = seq;
  32. return cb(cl, buffer + ip_len + headersize, payload_len);