2
0

200-fix-extension-init.patch 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. --- a/extensions/Makefile
  2. +++ b/extensions/Makefile
  3. @@ -11,13 +11,13 @@ EXT_LIBSI+=$(foreach T,$(EXT_FUNC), -leb
  4. EXT_LIBSI+=$(foreach T,$(EXT_TABLES), -lebtable_$(T))
  5. extensions/ebt_%.so: extensions/ebt_%.o
  6. - $(CC) $(LDFLAGS) -shared -o $@ -lc $< -nostartfiles
  7. + $(CC) $(LDFLAGS) -shared -o $@ -lc $<
  8. extensions/libebt_%.so: extensions/ebt_%.so
  9. mv $< $@
  10. extensions/ebtable_%.so: extensions/ebtable_%.o
  11. - $(CC) $(LDFLAGS) -shared -o $@ -lc $< -nostartfiles
  12. + $(CC) $(LDFLAGS) -shared -o $@ -lc $<
  13. extensions/libebtable_%.so: extensions/ebtable_%.so
  14. mv $< $@
  15. --- a/extensions/ebt_802_3.c
  16. +++ b/extensions/ebt_802_3.c
  17. @@ -141,7 +141,7 @@ static struct ebt_u_match _802_3_match =
  18. .extra_ops = opts,
  19. };
  20. -void _init(void)
  21. +__attribute__((constructor)) static void extension_init(void)
  22. {
  23. ebt_register_match(&_802_3_match);
  24. }
  25. --- a/extensions/ebt_among.c
  26. +++ b/extensions/ebt_among.c
  27. @@ -491,7 +491,7 @@ static struct ebt_u_match among_match =
  28. .extra_ops = opts,
  29. };
  30. -void _init(void)
  31. +__attribute__((constructor)) static void extension_init(void)
  32. {
  33. ebt_register_match(&among_match);
  34. }
  35. --- a/extensions/ebt_arp.c
  36. +++ b/extensions/ebt_arp.c
  37. @@ -362,7 +362,7 @@ static struct ebt_u_match arp_match =
  38. .extra_ops = opts,
  39. };
  40. -void _init(void)
  41. +__attribute__((constructor)) static void extension_init(void)
  42. {
  43. ebt_register_match(&arp_match);
  44. }
  45. --- a/extensions/ebt_arpreply.c
  46. +++ b/extensions/ebt_arpreply.c
  47. @@ -133,7 +133,7 @@ static struct ebt_u_target arpreply_targ
  48. .extra_ops = opts,
  49. };
  50. -void _init(void)
  51. +__attribute__((constructor)) static void extension_init(void)
  52. {
  53. ebt_register_target(&arpreply_target);
  54. }
  55. --- a/extensions/ebt_ip.c
  56. +++ b/extensions/ebt_ip.c
  57. @@ -338,7 +338,7 @@ static struct ebt_u_match ip_match =
  58. .extra_ops = opts,
  59. };
  60. -void _init(void)
  61. +__attribute__((constructor)) static void extension_init(void)
  62. {
  63. ebt_register_match(&ip_match);
  64. }
  65. --- a/extensions/ebt_ip6.c
  66. +++ b/extensions/ebt_ip6.c
  67. @@ -560,7 +560,7 @@ static struct ebt_u_match ip6_match =
  68. .extra_ops = opts,
  69. };
  70. -void _init(void)
  71. +__attribute__((constructor)) static void extension_init(void)
  72. {
  73. ebt_register_match(&ip6_match);
  74. }
  75. --- a/extensions/ebt_limit.c
  76. +++ b/extensions/ebt_limit.c
  77. @@ -212,7 +212,7 @@ static struct ebt_u_match limit_match =
  78. .extra_ops = opts,
  79. };
  80. -void _init(void)
  81. +__attribute__((constructor)) static void extension_init(void)
  82. {
  83. ebt_register_match(&limit_match);
  84. }
  85. --- a/extensions/ebt_log.c
  86. +++ b/extensions/ebt_log.c
  87. @@ -217,7 +217,7 @@ static struct ebt_u_watcher log_watcher
  88. .extra_ops = opts,
  89. };
  90. -void _init(void)
  91. +__attribute__((constructor)) static void extension_init(void)
  92. {
  93. ebt_register_watcher(&log_watcher);
  94. }
  95. --- a/extensions/ebt_mark.c
  96. +++ b/extensions/ebt_mark.c
  97. @@ -172,7 +172,7 @@ static struct ebt_u_target mark_target =
  98. .extra_ops = opts,
  99. };
  100. -void _init(void)
  101. +__attribute__((constructor)) static void extension_init(void)
  102. {
  103. ebt_register_target(&mark_target);
  104. }
  105. --- a/extensions/ebt_mark_m.c
  106. +++ b/extensions/ebt_mark_m.c
  107. @@ -121,7 +121,7 @@ static struct ebt_u_match mark_match =
  108. .extra_ops = opts,
  109. };
  110. -void _init(void)
  111. +__attribute__((constructor)) static void extension_init(void)
  112. {
  113. ebt_register_match(&mark_match);
  114. }
  115. --- a/extensions/ebt_nat.c
  116. +++ b/extensions/ebt_nat.c
  117. @@ -231,7 +231,7 @@ static struct ebt_u_target dnat_target =
  118. .extra_ops = opts_d,
  119. };
  120. -void _init(void)
  121. +__attribute__((constructor)) static void extension_init(void)
  122. {
  123. ebt_register_target(&snat_target);
  124. ebt_register_target(&dnat_target);
  125. --- a/extensions/ebt_nflog.c
  126. +++ b/extensions/ebt_nflog.c
  127. @@ -166,7 +166,7 @@ static struct ebt_u_watcher nflog_watche
  128. .extra_ops = nflog_opts,
  129. };
  130. -void _init(void)
  131. +__attribute__((constructor)) static void extension_init(void)
  132. {
  133. ebt_register_watcher(&nflog_watcher);
  134. }
  135. --- a/extensions/ebt_pkttype.c
  136. +++ b/extensions/ebt_pkttype.c
  137. @@ -125,7 +125,7 @@ static struct ebt_u_match pkttype_match
  138. .extra_ops = opts,
  139. };
  140. -void _init(void)
  141. +__attribute__((constructor)) static void extension_init(void)
  142. {
  143. ebt_register_match(&pkttype_match);
  144. }
  145. --- a/extensions/ebt_redirect.c
  146. +++ b/extensions/ebt_redirect.c
  147. @@ -108,7 +108,7 @@ static struct ebt_u_target redirect_targ
  148. .extra_ops = opts,
  149. };
  150. -void _init(void)
  151. +__attribute__((constructor)) static void extension_init(void)
  152. {
  153. ebt_register_target(&redirect_target);
  154. }
  155. --- a/extensions/ebt_standard.c
  156. +++ b/extensions/ebt_standard.c
  157. @@ -84,7 +84,7 @@ static struct ebt_u_target standard =
  158. .extra_ops = opts,
  159. };
  160. -void _init(void)
  161. +__attribute__((constructor)) static void extension_init(void)
  162. {
  163. ebt_register_target(&standard);
  164. }
  165. --- a/extensions/ebt_stp.c
  166. +++ b/extensions/ebt_stp.c
  167. @@ -337,7 +337,7 @@ static struct ebt_u_match stp_match =
  168. .extra_ops = opts,
  169. };
  170. -void _init(void)
  171. +__attribute__((constructor)) static void extension_init(void)
  172. {
  173. ebt_register_match(&stp_match);
  174. }
  175. --- a/extensions/ebt_ulog.c
  176. +++ b/extensions/ebt_ulog.c
  177. @@ -180,7 +180,7 @@ static struct ebt_u_watcher ulog_watcher
  178. .extra_ops = opts,
  179. };
  180. -void _init(void)
  181. +__attribute__((constructor)) static void extension_init(void)
  182. {
  183. ebt_register_watcher(&ulog_watcher);
  184. }
  185. --- a/extensions/ebt_vlan.c
  186. +++ b/extensions/ebt_vlan.c
  187. @@ -181,7 +181,7 @@ static struct ebt_u_match vlan_match = {
  188. .extra_ops = opts,
  189. };
  190. -void _init(void)
  191. +__attribute__((constructor)) static void extension_init(void)
  192. {
  193. ebt_register_match(&vlan_match);
  194. }
  195. --- a/extensions/ebtable_broute.c
  196. +++ b/extensions/ebtable_broute.c
  197. @@ -23,7 +23,7 @@ ebt_u_table table =
  198. .help = print_help,
  199. };
  200. -void _init(void)
  201. +__attribute__((constructor)) static void extension_init(void)
  202. {
  203. ebt_register_table(&table);
  204. }
  205. --- a/extensions/ebtable_filter.c
  206. +++ b/extensions/ebtable_filter.c
  207. @@ -29,7 +29,7 @@ static struct ebt_u_table table =
  208. .help = print_help,
  209. };
  210. -void _init(void)
  211. +__attribute__((constructor)) static void extension_init(void)
  212. {
  213. ebt_register_table(&table);
  214. }
  215. --- a/extensions/ebtable_nat.c
  216. +++ b/extensions/ebtable_nat.c
  217. @@ -30,7 +30,7 @@ ebt_u_table table =
  218. .help = print_help,
  219. };
  220. -void _init(void)
  221. +__attribute__((constructor)) static void extension_init(void)
  222. {
  223. ebt_register_table(&table);
  224. }