01-honor_includes_remove_backtrace.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. diff -urN orig/l2tpns-2.1.14/Makefile l2tpns-2.1.14/Makefile
  2. --- orig/l2tpns-2.1.14/Makefile 2005-12-07 06:21:37.000000000 +0100
  3. +++ l2tpns-2.1.14/Makefile 2005-12-14 12:50:49.000000000 +0100
  4. @@ -11,17 +11,14 @@
  5. DEFINES += -DETCDIR='"$(etcdir)"'
  6. OPTIM =
  7. -OPTIM += -g
  8. OPTIM += -O3
  9. -CC = gcc
  10. -LD = gcc
  11. -INCLUDES = -I.
  12. +INCLUDES = -I. -I$(STAGING_DIR)/usr/include
  13. CPPFLAGS = $(INCLUDES) $(DEFINES)
  14. CFLAGS = -Wall -Wformat-security -Wno-format-zero-length $(OPTIM)
  15. -LDFLAGS =
  16. +LDFLAGS = -L$(STAGING_DIR)/usr/lib
  17. LDLIBS =
  18. -INSTALL = install -c -D -o root -g root
  19. +INSTALL = install -c -D
  20. l2tpns.LIBS = -lm -lcli -ldl
  21. diff -urN orig/l2tpns-2.1.14/l2tpns.c l2tpns-2.1.14/l2tpns.c
  22. --- orig/l2tpns-2.1.14/l2tpns.c 2005-12-07 06:21:37.000000000 +0100
  23. +++ l2tpns-2.1.14/l2tpns.c 2005-12-14 12:50:36.000000000 +0100
  24. @@ -940,18 +940,14 @@
  25. if (!t)
  26. {
  27. - static int backtrace_count = 0;
  28. LOG(0, 0, t, "tunnelsend called with 0 as tunnel id\n");
  29. STAT(tunnel_tx_errors);
  30. - log_backtrace(backtrace_count, 5)
  31. return;
  32. }
  33. if (!tunnel[t].ip)
  34. {
  35. - static int backtrace_count = 0;
  36. LOG(1, 0, t, "Error sending data out tunnel: no remote endpoint (tunnel not set up)\n");
  37. - log_backtrace(backtrace_count, 5)
  38. STAT(tunnel_tx_errors);
  39. return;
  40. }
  41. @@ -4125,23 +4121,8 @@
  42. struct sched_param params = {0};
  43. params.sched_priority = 1;
  44. - if (get_nprocs() < 2)
  45. - {
  46. - LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n");
  47. - config->scheduler_fifo = 0;
  48. - }
  49. - else
  50. - {
  51. - if ((ret = sched_setscheduler(0, SCHED_FIFO, &params)) == 0)
  52. - {
  53. - LOG(1, 0, 0, "Using FIFO scheduler. Say goodbye to any other processes running\n");
  54. - }
  55. - else
  56. - {
  57. - LOG(0, 0, 0, "Error setting scheduler to FIFO: %s\n", strerror(errno));
  58. - config->scheduler_fifo = 0;
  59. - }
  60. - }
  61. + LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n");
  62. + config->scheduler_fifo = 0;
  63. }
  64. /* Set up the cluster communications port. */
  65. diff -urN orig/l2tpns-2.1.14/l2tpns.h l2tpns-2.1.14/l2tpns.h
  66. --- orig/l2tpns-2.1.14/l2tpns.h 2005-12-09 01:43:17.000000000 +0100
  67. +++ l2tpns-2.1.14/l2tpns.h 2005-12-14 07:43:51.000000000 +0100
  68. @@ -5,7 +5,6 @@
  69. #define __L2TPNS_H__
  70. #include <netinet/in.h>
  71. -#include <execinfo.h>
  72. #include <stdio.h>
  73. #include <signal.h>
  74. #include <stdlib.h>
  75. @@ -766,21 +765,6 @@
  76. extern ippoolt *ip_address_pool;
  77. #define sessionfree (session[0].next)
  78. -#define log_backtrace(count, max) \
  79. -if (count++ < max) { \
  80. - void *array[20]; \
  81. - char **strings; \
  82. - int size, i; \
  83. - LOG(0, 0, t, "Backtrace follows:\n"); \
  84. - size = backtrace(array, 10); \
  85. - strings = backtrace_symbols(array, size); \
  86. - if (strings) for (i = 0; i < size; i++) \
  87. - { \
  88. - LOG(0, 0, t, " %s\n", strings[i]); \
  89. - } \
  90. - free(strings); \
  91. -}
  92. -
  93. extern configt *config;
  94. extern time_t basetime; // Time when this process started.
  95. diff -urN orig/l2tpns-2.1.14/ppp.c l2tpns-2.1.14/ppp.c
  96. --- orig/l2tpns-2.1.14/ppp.c 2005-12-07 06:21:37.000000000 +0100
  97. +++ l2tpns-2.1.14/ppp.c 2005-12-14 07:43:08.000000000 +0100
  98. @@ -1755,9 +1755,7 @@
  99. {
  100. if (size < 12) // Need more space than this!!
  101. {
  102. - static int backtrace_count = 0;
  103. LOG(0, s, t, "makeppp buffer too small for L2TP header (size=%d)\n", size);
  104. - log_backtrace(backtrace_count, 5)
  105. return NULL;
  106. }
  107. @@ -1780,9 +1778,7 @@
  108. if (l + 12 > size)
  109. {
  110. - static int backtrace_count = 0;
  111. LOG(2, s, t, "makeppp would overflow buffer (size=%d, header+payload=%d)\n", size, l + 12);
  112. - log_backtrace(backtrace_count, 5)
  113. return NULL;
  114. }