1 |
commit: f383625b90c40d630679373e2596a58b5d55f900 |
2 |
Author: Rasmus Thomsen <rasmus.thomsen <AT> live <DOT> de> |
3 |
AuthorDate: Wed Mar 29 14:32:29 2017 +0000 |
4 |
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com> |
5 |
CommitDate: Wed Mar 29 16:44:01 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=f383625b |
7 |
|
8 |
net-firewall/ebtables: add ebuild with musl fixes |
9 |
|
10 |
net-firewall/ebtables/Manifest | 8 ++ |
11 |
net-firewall/ebtables/ebtables-2.0.10.4-r1.ebuild | 74 +++++++++++ |
12 |
net-firewall/ebtables/ebtables-2.0.10.4.ebuild | 68 ++++++++++ |
13 |
.../ebtables/files/ebtables-2.0.8.1-ebt-save.diff | 31 +++++ |
14 |
net-firewall/ebtables/files/ebtables.confd-r1 | 11 ++ |
15 |
net-firewall/ebtables/files/ebtables.initd-r1 | 101 +++++++++++++++ |
16 |
net-firewall/ebtables/files/musl-fixes.patch | 141 +++++++++++++++++++++ |
17 |
net-firewall/ebtables/metadata.xml | 14 ++ |
18 |
8 files changed, 448 insertions(+) |
19 |
|
20 |
diff --git a/net-firewall/ebtables/Manifest b/net-firewall/ebtables/Manifest |
21 |
new file mode 100644 |
22 |
index 0000000..c1dc8c6 |
23 |
--- /dev/null |
24 |
+++ b/net-firewall/ebtables/Manifest |
25 |
@@ -0,0 +1,8 @@ |
26 |
+AUX ebtables-2.0.8.1-ebt-save.diff 1089 SHA256 b4d7022a616152ca439d2b09f14fda8a3ef479b823c2da44eb0e9e22b256be90 SHA512 904cb936ca6fc39dc4fa6e287ef70df9e1dacbd9dc464f839f25213f5525d4020f819dd893b784c5f611f1185c05ffbaa49423afcd6db2ef328950408a07e6a7 WHIRLPOOL df0664bc20dcd36bf640c8c88dea1e7d17b55c686403bceb77f5416b95ce0e2fc3292755e5986822b794628fc31aff25f7dab4d70d742fc93e78bac9fcdea4b2 |
27 |
+AUX ebtables.confd-r1 288 SHA256 c05a6c1ba6add3881068584074681b04bfb2ad43284d7bdd67f47f3da842de58 SHA512 088308eba077fcec35299c8aaad0492024173504a361c2ba7e29dce106888a78c72818a791f3d3655aed3f6df26a3319c42e2b2c54760cdbad036d46b89b97f3 WHIRLPOOL f6353fcc69beff674227544b36c3e2289f094758b02087d57b44fd0a73d7aa47500592404125bd2570ac2fa0da74aa18138e80c292ff5b21ee1ede13fa1125c4 |
28 |
+AUX ebtables.initd-r1 1990 SHA256 15772b575abdcf683b3ee9815a11b0f7f27602d7fe52673124710e310dc95ec6 SHA512 ceceaf33d6f6bfa89a5d81932e3ec76a26d09d67150efd3de587520ea47984f618d4fc55e799c58a2e5e236caec5bd81e2fde31a7e5aa328e629cdabbd29339b WHIRLPOOL e5af9b113da44c7185a8f7eed2004154270ed8d9c2c5908dc60f0329a402f9e50c978702d129699c639a208cbd7e26266c0d3ac2df2062df61b131c018a70aa1 |
29 |
+AUX musl-fixes.patch 3518 SHA256 670dfb2fc245cb7339b47604663281be843811846d6d1648ed0e02d6b765e36f SHA512 8d8d01b306db0cd410292cb489a0fd62669768f5c98b048c3fdc01f71b10d51ba8a6e9c12b85e1d251915426cd8c375e12189e2d061d4915b461d73901d7f40c WHIRLPOOL b665a775c1063e5b091055e667ce1b182e7fb7e85ab14ceeb68e07b9bfb3cc2c257220c120d7c8a307745ef091193db76a3c1962560d126e13cac8de9ea628ba |
30 |
+DIST ebtables-v2.0.10-4.tar.gz 103764 SHA256 dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d SHA512 a6832453812eaede3fcbb5b4cab5902ea1ea752a80a259eed276a01b61e2afaa6cf07d3d023d86a883f9a02505aecc44a1c6e0d27b3a61f341002e4c051cd60a WHIRLPOOL 5a1e0703e3fd5c79e149824e789646d042660081fb8a9f301fa4cc2716e84fbf842216d5b6b4c8c33de3b6949bfbfcaa2eb7293fe7afa71a2305de8f70abd57d |
31 |
+EBUILD ebtables-2.0.10.4-r1.ebuild 2120 SHA256 a56451a81a9eba79479c1960a22e3e7abb7db18f64456a984673f0bc429e661c SHA512 6601c1ee1e2c18d5f99b6490348053e8b76cc5218cb53067deeb5eb6180ef6e54f7ca7ce8aeb5050b2a586a25f46f346859feb3e13a6e7bfb083e58826e4d41c WHIRLPOOL 8b7ebd9f235f6baf4c9a4c4307cd4a492a1269f3a0281d25709dea399b3d99faa090c3b4015464f77ffdd6cb632636dfee5b22139b1a403e5f96e1f70e4495cb |
32 |
+EBUILD ebtables-2.0.10.4.ebuild 1949 SHA256 bfca59c1aff6d92f9b697d60342985450fead3fea0f733237640bee28de6e621 SHA512 8471cc4a24c02d5662aa10a876e40ea0b5bafdf51c29601bb080c61171dcf83c0cec6eb747367f72eb6832dcb153dcfa66d5d738a19476a716c3e8f7eb7484fc WHIRLPOOL aff7b417d65e3d31668cb363c7b19f00ba4ef6522ff2372506bfaeb1adf76baaf2693f16f18f40ff17e622d23529294fdc1cc9309d178820e01fecbb4708d7b0 |
33 |
+MISC metadata.xml 426 SHA256 4af9dfd3040d9bb4be1b873b11cfadd0cda1a68f6b6a9e6acefe9d4dbd84c60c SHA512 77ff48216c32448cf2e2aa580f0b3afd6de7aa9bda2c2379c89f77282c417d385bb8c3d3218cf6d30021e472163bc8f2b450f0e43d944adb336f49fb695ba231 WHIRLPOOL 702803e5ff88215990751ebd4afa5d4b230e723ac50b8b0fea751f9b5cf8f612cfa76fe84c1650009b738de480154b1b1196d8cdfabe58325a9e65e4d338f3c5 |
34 |
|
35 |
diff --git a/net-firewall/ebtables/ebtables-2.0.10.4-r1.ebuild b/net-firewall/ebtables/ebtables-2.0.10.4-r1.ebuild |
36 |
new file mode 100644 |
37 |
index 0000000..bdcbd7a |
38 |
--- /dev/null |
39 |
+++ b/net-firewall/ebtables/ebtables-2.0.10.4-r1.ebuild |
40 |
@@ -0,0 +1,74 @@ |
41 |
+# Copyright 1999-2015 Gentoo Foundation |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+ |
44 |
+EAPI="4" |
45 |
+ |
46 |
+inherit versionator eutils toolchain-funcs multilib flag-o-matic |
47 |
+ |
48 |
+MY_PV=$(replace_version_separator 3 '-' ) |
49 |
+MY_P=${PN}-v${MY_PV} |
50 |
+ |
51 |
+DESCRIPTION="Utility that enables basic Ethernet frame filtering on a Linux bridge, MAC NAT and brouting" |
52 |
+HOMEPAGE="http://ebtables.sourceforge.net/" |
53 |
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" |
54 |
+ |
55 |
+LICENSE="GPL-2" |
56 |
+SLOT="0" |
57 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86" |
58 |
+IUSE="+perl static" |
59 |
+ |
60 |
+# The ebtables-save script is written in perl. |
61 |
+RDEPEND="perl? ( dev-lang/perl )" |
62 |
+ |
63 |
+S=${WORKDIR}/${MY_P} |
64 |
+ |
65 |
+pkg_setup() { |
66 |
+ if use static; then |
67 |
+ ewarn "You've chosen static build which is useful for embedded devices." |
68 |
+ ewarn "It has no init script. Make sure that's really what you want." |
69 |
+ fi |
70 |
+} |
71 |
+ |
72 |
+src_prepare() { |
73 |
+ # Enhance ebtables-save to take table names as parameters bug #189315 |
74 |
+ epatch "${FILESDIR}/${PN}-2.0.8.1-ebt-save.diff" |
75 |
+ |
76 |
+ # Musl fixes |
77 |
+ epatch "${FILESDIR}/musl-fixes.patch" |
78 |
+ sed -i 's,<linux/if_ether.h>,,netinet/if_ether.h>,g; /<linux\/if_pppox.h>/d' include/linux/netfilter_bridge.h include/linux/netfilter_bridge/ebtables.h extensions/ebt_*.c |
79 |
+ rm -f include/linux/if_ether.h |
80 |
+ |
81 |
+ sed -i -e "s,^MANDIR:=.*,MANDIR:=/usr/share/man," \ |
82 |
+ -e "s,^BINDIR:=.*,BINDIR:=/sbin," \ |
83 |
+ -e "s,^INITDIR:=.*,INITDIR:=/usr/share/doc/${PF}," \ |
84 |
+ -e "s,^SYSCONFIGDIR:=.*,SYSCONFIGDIR:=/usr/share/doc/${PF}," \ |
85 |
+ -e "s,^LIBDIR:=.*,LIBDIR:=/$(get_libdir)/\$(PROGNAME)," Makefile |
86 |
+} |
87 |
+ |
88 |
+src_compile() { |
89 |
+ # This package uses _init functions to initialise extensions. With |
90 |
+ # --as-needed this will not work. |
91 |
+ append-ldflags $(no-as-needed) |
92 |
+ emake \ |
93 |
+ CC="$(tc-getCC)" \ |
94 |
+ CFLAGS="${CFLAGS}" \ |
95 |
+ $(use static && echo static) |
96 |
+} |
97 |
+ |
98 |
+src_install() { |
99 |
+ if ! use static; then |
100 |
+ emake DESTDIR="${D}" install |
101 |
+ keepdir /var/lib/ebtables/ |
102 |
+ newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables |
103 |
+ newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables |
104 |
+ if ! use perl; then |
105 |
+ rm "${ED}"/sbin/ebtables-save || die |
106 |
+ fi |
107 |
+ else |
108 |
+ into / |
109 |
+ newsbin static ebtables |
110 |
+ insinto /etc |
111 |
+ doins ethertypes |
112 |
+ fi |
113 |
+ dodoc ChangeLog THANKS |
114 |
+} |
115 |
|
116 |
diff --git a/net-firewall/ebtables/ebtables-2.0.10.4.ebuild b/net-firewall/ebtables/ebtables-2.0.10.4.ebuild |
117 |
new file mode 100644 |
118 |
index 0000000..c7b50d4 |
119 |
--- /dev/null |
120 |
+++ b/net-firewall/ebtables/ebtables-2.0.10.4.ebuild |
121 |
@@ -0,0 +1,68 @@ |
122 |
+# Copyright 1999-2014 Gentoo Foundation |
123 |
+# Distributed under the terms of the GNU General Public License v2 |
124 |
+ |
125 |
+EAPI="4" |
126 |
+ |
127 |
+inherit versionator eutils toolchain-funcs multilib flag-o-matic |
128 |
+ |
129 |
+MY_PV=$(replace_version_separator 3 '-' ) |
130 |
+MY_P=${PN}-v${MY_PV} |
131 |
+ |
132 |
+DESCRIPTION="Utility that enables basic Ethernet frame filtering on a Linux bridge, MAC NAT and brouting" |
133 |
+HOMEPAGE="http://ebtables.sourceforge.net/" |
134 |
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" |
135 |
+ |
136 |
+KEYWORDS="amd64 ppc x86" |
137 |
+IUSE="static" |
138 |
+LICENSE="GPL-2" |
139 |
+SLOT="0" |
140 |
+ |
141 |
+S=${WORKDIR}/${MY_P} |
142 |
+ |
143 |
+pkg_setup() { |
144 |
+ if use static; then |
145 |
+ ewarn "You've chosen static build which is useful for embedded devices." |
146 |
+ ewarn "It has no init script. Make sure that's really what you want." |
147 |
+ fi |
148 |
+} |
149 |
+ |
150 |
+src_prepare() { |
151 |
+ # Enhance ebtables-save to take table names as parameters bug #189315 |
152 |
+ epatch "${FILESDIR}/${PN}-2.0.8.1-ebt-save.diff" |
153 |
+ |
154 |
+ # Musl fixes |
155 |
+ epatch "${FILESDIR}/musl-fixes.patch" |
156 |
+ sed -i 's,<linux/if_ether.h>,,netinet/if_ether.h>,g; /<linux\/if_pppox.h>/d' include/linux/netfilter_bridge.h include/linux/netfilter_bridge/ebtables.h extensions/ebt_*.c |
157 |
+ rm -f include/linux/if_ether.h |
158 |
+ |
159 |
+ sed -i -e "s,^MANDIR:=.*,MANDIR:=/usr/share/man," \ |
160 |
+ -e "s,^BINDIR:=.*,BINDIR:=/sbin," \ |
161 |
+ -e "s,^INITDIR:=.*,INITDIR:=/usr/share/doc/${PF}," \ |
162 |
+ -e "s,^SYSCONFIGDIR:=.*,SYSCONFIGDIR:=/usr/share/doc/${PF}," \ |
163 |
+ -e "s,^LIBDIR:=.*,LIBDIR:=/$(get_libdir)/\$(PROGNAME)," Makefile |
164 |
+} |
165 |
+ |
166 |
+src_compile() { |
167 |
+ # This package uses _init functions to initialise extensions. With |
168 |
+ # --as-needed this will not work. |
169 |
+ append-ldflags $(no-as-needed) |
170 |
+ emake \ |
171 |
+ CC="$(tc-getCC)" \ |
172 |
+ CFLAGS="${CFLAGS}" \ |
173 |
+ $(use static && echo static) |
174 |
+} |
175 |
+ |
176 |
+src_install() { |
177 |
+ if ! use static; then |
178 |
+ make DESTDIR="${D}" install |
179 |
+ keepdir /var/lib/ebtables/ |
180 |
+ newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables |
181 |
+ newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables |
182 |
+ else |
183 |
+ into / |
184 |
+ newsbin static ebtables |
185 |
+ insinto /etc |
186 |
+ doins ethertypes |
187 |
+ fi |
188 |
+ dodoc ChangeLog THANKS |
189 |
+} |
190 |
|
191 |
diff --git a/net-firewall/ebtables/files/ebtables-2.0.8.1-ebt-save.diff b/net-firewall/ebtables/files/ebtables-2.0.8.1-ebt-save.diff |
192 |
new file mode 100644 |
193 |
index 0000000..cdfd823 |
194 |
--- /dev/null |
195 |
+++ b/net-firewall/ebtables/files/ebtables-2.0.8.1-ebt-save.diff |
196 |
@@ -0,0 +1,31 @@ |
197 |
+--- ./ebtables-save.orig 2007-09-28 22:50:35.000000000 +0400 |
198 |
++++ ./ebtables-save 2007-09-28 22:51:22.000000000 +0400 |
199 |
+@@ -12,6 +12,7 @@ |
200 |
+ my $cnt = ""; |
201 |
+ my $version = "1.0"; |
202 |
+ my $table_name; |
203 |
++my @table_names; |
204 |
+ |
205 |
+ # ======================================================== |
206 |
+ # Process filter table |
207 |
+@@ -49,12 +50,19 @@ |
208 |
+ } |
209 |
+ # ======================================================== |
210 |
+ |
211 |
++if ($#ARGV + 1 == 0) { |
212 |
++ @table_names =split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`); |
213 |
++} |
214 |
++else { |
215 |
++ @table_names = @ARGV; |
216 |
++} |
217 |
++# ======================================================== |
218 |
+ unless (-x $ebtables) { exit -1 }; |
219 |
+ print "# Generated by ebtables-save v$version on " . `date`; |
220 |
+ if (defined($ENV{'EBTABLES_SAVE_COUNTER'}) && $ENV{'EBTABLES_SAVE_COUNTER'} eq "yes") { |
221 |
+ $cnt = "--Lc"; |
222 |
+ } |
223 |
+-foreach $table_name (split("\n", `grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//`)) { |
224 |
++foreach $table_name (@table_names) { |
225 |
+ $table =`$ebtables -t $table_name -L $cnt`; |
226 |
+ unless ($? == 0) { print $table; exit -1 }; |
227 |
+ &process_table($table); |
228 |
|
229 |
diff --git a/net-firewall/ebtables/files/ebtables.confd-r1 b/net-firewall/ebtables/files/ebtables.confd-r1 |
230 |
new file mode 100644 |
231 |
index 0000000..645b26e |
232 |
--- /dev/null |
233 |
+++ b/net-firewall/ebtables/files/ebtables.confd-r1 |
234 |
@@ -0,0 +1,11 @@ |
235 |
+# /etc/conf.d/ebtables |
236 |
+ |
237 |
+# Location in which ebtables initscript will save set rules on |
238 |
+# service shutdown |
239 |
+EBTABLES_SAVE="/var/lib/ebtables/rules-save" |
240 |
+ |
241 |
+# Options to pass to ebtables-save and ebtables-restore |
242 |
+SAVE_RESTORE_OPTIONS="" |
243 |
+ |
244 |
+# Save state on stopping ebtables |
245 |
+SAVE_ON_STOP="yes" |
246 |
|
247 |
diff --git a/net-firewall/ebtables/files/ebtables.initd-r1 b/net-firewall/ebtables/files/ebtables.initd-r1 |
248 |
new file mode 100644 |
249 |
index 0000000..9c78e9b |
250 |
--- /dev/null |
251 |
+++ b/net-firewall/ebtables/files/ebtables.initd-r1 |
252 |
@@ -0,0 +1,101 @@ |
253 |
+#!/sbin/openrc-run |
254 |
+# Copyright 1999-2012 Gentoo Foundation |
255 |
+# Distributed under the terms of the GNU General Public License v2 |
256 |
+ |
257 |
+extra_commands="save panic" |
258 |
+extra_started_commands="reload" |
259 |
+ |
260 |
+ebtables_bin="/sbin/ebtables" |
261 |
+ebtables_save=${EBTABLES_SAVE} |
262 |
+ |
263 |
+depend() { |
264 |
+ before net |
265 |
+ use logger |
266 |
+} |
267 |
+ |
268 |
+ebtables_tables() { |
269 |
+ for table in filter nat broute; do |
270 |
+ if ${ebtables_bin} -t ${table} -L > /dev/null 2>&1; then |
271 |
+ echo -n "${table} " |
272 |
+ fi |
273 |
+ done |
274 |
+} |
275 |
+ |
276 |
+set_table_policy() { |
277 |
+ local chains table=$1 policy=$2 |
278 |
+ case ${table} in |
279 |
+ nat) chains="PREROUTING POSTROUTING OUTPUT";; |
280 |
+ broute) chains="BROUTING";; |
281 |
+ filter) chains="INPUT FORWARD OUTPUT";; |
282 |
+ *) chains="";; |
283 |
+ esac |
284 |
+ local chain |
285 |
+ for chain in ${chains} ; do |
286 |
+ ${ebtables_bin} -t ${table} -P ${chain} ${policy} |
287 |
+ done |
288 |
+} |
289 |
+ |
290 |
+checkconfig() { |
291 |
+ if [ ! -f ${ebtables_save} ] ; then |
292 |
+ eerror "Not starting ebtables. First create some rules then run:" |
293 |
+ eerror "/etc/init.d/ebtables save" |
294 |
+ return 1 |
295 |
+ fi |
296 |
+ return 0 |
297 |
+} |
298 |
+ |
299 |
+start() { |
300 |
+ checkconfig || return 1 |
301 |
+ ebegin "Loading ebtables state and starting bridge firewall" |
302 |
+ ${ebtables_bin}-restore ${SAVE_RESTORE_OPTIONS} < "${ebtables_save}" |
303 |
+ eend $? |
304 |
+} |
305 |
+ |
306 |
+stop() { |
307 |
+ if [ "${SAVE_ON_STOP}" = "yes" ] ; then |
308 |
+ save || return 1 |
309 |
+ fi |
310 |
+ ebegin "Stopping bridge firewall" |
311 |
+ local a |
312 |
+ for a in $(ebtables_tables); do |
313 |
+ set_table_policy $a ACCEPT |
314 |
+ |
315 |
+ ${ebtables_bin} -t $a -F |
316 |
+ ${ebtables_bin} -t $a -X |
317 |
+ done |
318 |
+ eend $? |
319 |
+} |
320 |
+ |
321 |
+reload() { |
322 |
+ ebegin "Flushing bridge firewall" |
323 |
+ local a |
324 |
+ for a in $(ebtables_tables); do |
325 |
+ ${ebtables_bin} -t $a -F |
326 |
+ ${ebtables_bin} -t $a -X |
327 |
+ done |
328 |
+ eend $? |
329 |
+ |
330 |
+ start |
331 |
+} |
332 |
+ |
333 |
+save() { |
334 |
+ ebegin "Saving ebtables state" |
335 |
+ touch "${ebtables_save}" |
336 |
+ chmod 0600 "${ebtables_save}" |
337 |
+ ${ebtables_bin}-save $(ebtables_tables) ${SAVE_RESTORE_OPTIONS} > "${ebtables_save}" |
338 |
+ eend $? |
339 |
+} |
340 |
+ |
341 |
+panic() { |
342 |
+ service_started ebtables && svc_stop |
343 |
+ |
344 |
+ local a |
345 |
+ ebegin "Dropping all packets forwarded on bridges" |
346 |
+ for a in $(ebtables_tables); do |
347 |
+ ${ebtables_bin} -t $a -F |
348 |
+ ${ebtables_bin} -t $a -X |
349 |
+ |
350 |
+ set_table_policy $a DROP |
351 |
+ done |
352 |
+ eend $? |
353 |
+} |
354 |
|
355 |
diff --git a/net-firewall/ebtables/files/musl-fixes.patch b/net-firewall/ebtables/files/musl-fixes.patch |
356 |
new file mode 100644 |
357 |
index 0000000..46ee83a |
358 |
--- /dev/null |
359 |
+++ b/net-firewall/ebtables/files/musl-fixes.patch |
360 |
@@ -0,0 +1,141 @@ |
361 |
+This patch was made by Natanael Copa of the Alpine Linux project. |
362 |
+http://git.alpinelinux.org/cgit/aports/commit/?id=0f5076024a9700644ac9d542d2ca643fa38e77da |
363 |
+ |
364 |
+--- Makefile.orig |
365 |
++++ Makefile |
366 |
+@@ -17,7 +17,7 @@ |
367 |
+ SYSCONFIGDIR:=/etc/sysconfig |
368 |
+ DESTDIR:= |
369 |
+ |
370 |
+-CFLAGS:=-Wall -Wunused -Werror |
371 |
++CFLAGS:=-Wall -Wunused |
372 |
+ CFLAGS_SH_LIB:=-fPIC -O3 |
373 |
+ CC:=gcc |
374 |
+ |
375 |
+--- extensions/ebt_among.c.orig |
376 |
++++ extensions/ebt_among.c |
377 |
+@@ -12,14 +12,14 @@ |
378 |
+ #include <getopt.h> |
379 |
+ #include <ctype.h> |
380 |
+ #include <unistd.h> |
381 |
+-#include "../include/ebtables_u.h" |
382 |
++#include <sys/mman.h> |
383 |
++#include <sys/stat.h> |
384 |
++#include <fcntl.h> |
385 |
+ #include <netinet/ether.h> |
386 |
++#include "../include/ebtables_u.h" |
387 |
+ #include "../include/ethernetdb.h" |
388 |
+ #include <linux/if_ether.h> |
389 |
+ #include <linux/netfilter_bridge/ebt_among.h> |
390 |
+-#include <sys/mman.h> |
391 |
+-#include <sys/stat.h> |
392 |
+-#include <fcntl.h> |
393 |
+ |
394 |
+ #define AMONG_DST '1' |
395 |
+ #define AMONG_SRC '2' |
396 |
+--- extensions/ebt_arpreply.c.orig |
397 |
++++ extensions/ebt_arpreply.c |
398 |
+@@ -11,8 +11,8 @@ |
399 |
+ #include <stdlib.h> |
400 |
+ #include <string.h> |
401 |
+ #include <getopt.h> |
402 |
+-#include "../include/ebtables_u.h" |
403 |
+ #include <netinet/ether.h> |
404 |
++#include "../include/ebtables_u.h" |
405 |
+ #include <linux/netfilter_bridge/ebt_arpreply.h> |
406 |
+ |
407 |
+ static int mac_supplied; |
408 |
+--- extensions/ebt_ip6.c.orig |
409 |
++++ extensions/ebt_ip6.c |
410 |
+@@ -53,8 +53,8 @@ |
411 |
+ |
412 |
+ struct icmpv6_names { |
413 |
+ const char *name; |
414 |
+- u_int8_t type; |
415 |
+- u_int8_t code_min, code_max; |
416 |
++ uint8_t type; |
417 |
++ uint8_t code_min, code_max; |
418 |
+ }; |
419 |
+ |
420 |
+ static const struct icmpv6_names icmpv6_codes[] = { |
421 |
+--- extensions/ebt_limit.c.orig |
422 |
++++ extensions/ebt_limit.c |
423 |
+@@ -59,11 +59,11 @@ |
424 |
+ " default %u\n", EBT_LIMIT_BURST); |
425 |
+ } |
426 |
+ |
427 |
+-static int parse_rate(const char *rate, u_int32_t *val) |
428 |
++static int parse_rate(const char *rate, uint32_t *val) |
429 |
+ { |
430 |
+ const char *delim; |
431 |
+- u_int32_t r; |
432 |
+- u_int32_t mult = 1; /* Seconds by default. */ |
433 |
++ uint32_t r; |
434 |
++ uint32_t mult = 1; /* Seconds by default. */ |
435 |
+ |
436 |
+ delim = strchr(rate, '/'); |
437 |
+ if (delim) { |
438 |
+@@ -151,7 +151,7 @@ |
439 |
+ struct rates |
440 |
+ { |
441 |
+ const char *name; |
442 |
+- u_int32_t mult; |
443 |
++ uint32_t mult; |
444 |
+ }; |
445 |
+ |
446 |
+ static struct rates g_rates[] = |
447 |
+@@ -162,7 +162,7 @@ |
448 |
+ { "sec", EBT_LIMIT_SCALE } |
449 |
+ }; |
450 |
+ |
451 |
+-static void print_rate(u_int32_t period) |
452 |
++static void print_rate(uint32_t period) |
453 |
+ { |
454 |
+ unsigned int i; |
455 |
+ |
456 |
+--- extensions/ebt_nat.c.orig |
457 |
++++ extensions/ebt_nat.c |
458 |
+@@ -10,8 +10,8 @@ |
459 |
+ #include <stdlib.h> |
460 |
+ #include <string.h> |
461 |
+ #include <getopt.h> |
462 |
+-#include "../include/ebtables_u.h" |
463 |
+ #include <netinet/ether.h> |
464 |
++#include "../include/ebtables_u.h" |
465 |
+ #include <linux/netfilter_bridge/ebt_nat.h> |
466 |
+ |
467 |
+ static int to_source_supplied, to_dest_supplied; |
468 |
+--- include/ethernetdb.h.orig |
469 |
++++ include/ethernetdb.h |
470 |
+@@ -30,6 +30,10 @@ |
471 |
+ #define _PATH_ETHERTYPES "/etc/ethertypes" |
472 |
+ #endif /* _PATH_ETHERTYPES */ |
473 |
+ |
474 |
++#ifndef __THROW |
475 |
++#define __THROW |
476 |
++#endif |
477 |
++ |
478 |
+ struct ethertypeent { |
479 |
+ char *e_name; /* Official ethernet type name. */ |
480 |
+ char **e_aliases; /* Alias list. */ |
481 |
+--- useful_functions.c.orig |
482 |
++++ useful_functions.c |
483 |
+@@ -22,8 +22,7 @@ |
484 |
+ * along with this program; if not, write to the Free Software |
485 |
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
486 |
+ */ |
487 |
+-#include "include/ebtables_u.h" |
488 |
+-#include "include/ethernetdb.h" |
489 |
++#define _GNU_SOURCE |
490 |
+ #include <stdio.h> |
491 |
+ #include <netinet/ether.h> |
492 |
+ #include <string.h> |
493 |
+@@ -33,6 +32,8 @@ |
494 |
+ #include <sys/types.h> |
495 |
+ #include <sys/socket.h> |
496 |
+ #include <arpa/inet.h> |
497 |
++#include "include/ebtables_u.h" |
498 |
++#include "include/ethernetdb.h" |
499 |
+ |
500 |
+ const unsigned char mac_type_unicast[ETH_ALEN] = {0,0,0,0,0,0}; |
501 |
+ const unsigned char msk_type_unicast[ETH_ALEN] = {1,0,0,0,0,0}; |
502 |
|
503 |
diff --git a/net-firewall/ebtables/metadata.xml b/net-firewall/ebtables/metadata.xml |
504 |
new file mode 100644 |
505 |
index 0000000..16ad142 |
506 |
--- /dev/null |
507 |
+++ b/net-firewall/ebtables/metadata.xml |
508 |
@@ -0,0 +1,14 @@ |
509 |
+<?xml version="1.0" encoding="UTF-8"?> |
510 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
511 |
+<pkgmetadata> |
512 |
+ <maintainer type="project"> |
513 |
+ <email>base-system@g.o</email> |
514 |
+ <name>Gentoo Base System</name> |
515 |
+ </maintainer> |
516 |
+ <use> |
517 |
+ <flag name="perl">Install the ebtables-save script which uses perl</flag> |
518 |
+ </use> |
519 |
+ <upstream> |
520 |
+ <remote-id type="sourceforge">ebtables</remote-id> |
521 |
+ </upstream> |
522 |
+</pkgmetadata> |