summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/arptables
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/arptables')
-rw-r--r--meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch30
-rw-r--r--meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch61
-rw-r--r--meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch77
-rw-r--r--meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch37
-rw-r--r--meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb34
5 files changed, 239 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch
new file mode 100644
index 000000000..0875344fe
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch
@@ -0,0 +1,30 @@
1arptables: fix the redefinition of 'arpt_get_target'
2
3Upstream-Status: Pending
4
5This function is already defined as a static inline function in
6include/linux/netfilter_arp/arp_tables.h, once GCC uses -O0, the
7inline will not work, and the redefinition error will happen
8
9Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
10Signed-off-by: Roy.Li <rongqing.li@windriver.com>
11
12diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c
13index 35736db..addd3f9 100644
14--- a/libarptc/libarptc_incl.c
15+++ b/libarptc/libarptc_incl.c
16@@ -11,14 +11,6 @@
17 /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See
18 COPYING for details). */
19
20-#ifndef __OPTIMIZE__
21-STRUCT_ENTRY_TARGET *
22-GET_TARGET(STRUCT_ENTRY *e)
23-{
24- return (void *)e + e->target_offset;
25-}
26-#endif
27-
28 static int sockfd = -1;
29 static void *arptc_fn = NULL;
30
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch
new file mode 100644
index 000000000..80e980472
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch
@@ -0,0 +1,61 @@
1Index: arptables-v0.0.3-4/Makefile
2===================================================================
3--- arptables-v0.0.3-4.orig/Makefile 2010-03-08 18:49:28.000000000 +0300
4+++ arptables-v0.0.3-4/Makefile 2010-03-22 15:52:56.000000000 +0300
5@@ -6,12 +6,11 @@
6 LIBDIR:=$(PREFIX)/lib
7 BINDIR:=$(PREFIX)/sbin
8 MANDIR:=$(PREFIX)/man
9-INITDIR:=/etc/rc.d/init.d
10+INITDIR:=/etc/init.d
11 SYSCONFIGDIR:=/etc/sysconfig
12 DESTDIR:=
13
14-COPT_FLAGS:=-O2
15-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
16+ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
17
18 ifndef ARPT_LIBDIR
19 ARPT_LIBDIR:=$(LIBDIR)/arptables
20@@ -22,16 +21,16 @@
21 all: arptables
22
23 arptables.o: arptables.c
24- $(CC) $(CFLAGS) -c -o $@ $<
25+ $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $<
26
27 arptables-standalone.o: arptables-standalone.c
28- $(CC) $(CFLAGS) -c -o $@ $<
29+ $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $<
30
31 libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
32- $(CC) $(CFLAGS) -c -o $@ $<
33+ $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $<
34
35 arptables: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS)
36- $(CC) $(CFLAGS) -o $@ $^
37+ $(CC) $(LDFLAGS) $(CFLAGS) $(ARPCFLAGS) -o $@ $^
38
39 $(DESTDIR)$(MANDIR)/man8/arptables.8: arptables.8
40 mkdir -p $(@D)
41@@ -50,6 +49,7 @@
42 cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_
43 install -m 0755 -o root -g root arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
44 cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
45+ install -d $(DESTDIR)$(INITDIR)
46 if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
47 rm -f arptables-save_ arptables-restore_ arptables.sysv_
48
49Index: arptables-v0.0.3-4/extensions/Makefile
50===================================================================
51--- arptables-v0.0.3-4.orig/extensions/Makefile 2010-03-08 18:49:28.000000000 +0300
52+++ arptables-v0.0.3-4/extensions/Makefile 2010-03-22 15:52:38.000000000 +0300
53@@ -4,4 +4,7 @@
54 EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
55
56 extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
57- $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
58+ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
59+
60+extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
61+ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch
new file mode 100644
index 000000000..24956c4ca
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch
@@ -0,0 +1,77 @@
1Index: arptables-v0.0.3-4/arptables.sysv
2===================================================================
3--- arptables-v0.0.3-4.orig/arptables.sysv 2010-03-22 16:28:03.000000000 +0300
4+++ arptables-v0.0.3-4/arptables.sysv 2010-03-22 16:27:51.000000000 +0300
5@@ -12,10 +12,10 @@
6 # config: __SYSCONFIG__/arptables
7
8 source /etc/init.d/functions
9-source /etc/sysconfig/network
10+# source /etc/sysconfig/network
11
12 # Check that networking is up.
13-[ ${NETWORKING} = "no" ] && exit 0
14+# [ ${NETWORKING} = "no" ] && exit 0
15
16 [ -x __EXEC_PATH__/arptables ] || exit 1
17 [ -x __EXEC_PATH__/arptables-save ] || exit 1
18@@ -28,32 +28,30 @@
19 desc="Arp filtering"
20
21 start() {
22- echo -n $"Starting $desc ($prog): "
23+ echo -n "Starting $desc ($prog): "
24 __EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1
25
26 if [ $RETVAL -eq 0 ]; then
27- success "$prog startup"
28- rm -f /var/lock/subsys/$prog
29+ echo "$prog ok"
30+ touch /var/lock/subsys/$prog
31 else
32- failure "$prog startup"
33+ echo "$prog failed"
34 fi
35
36- echo
37 return $RETVAL
38 }
39
40 stop() {
41- echo -n $"Stopping $desc ($prog): "
42+ echo -n "Stopping $desc ($prog): "
43 __EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1
44
45 if [ $RETVAL -eq 0 ]; then
46- success "$prog shutdown"
47- rm -f %{_localstatedir}/lock/subsys/$prog
48+ echo "$prog stopped"
49+ rm -f /var/lock/subsys/$prog
50 else
51- failure "$prog shutdown"
52+ echo "$prog failed to stop"
53 fi
54
55- echo
56 return $RETVAL
57 }
58
59@@ -63,15 +61,14 @@
60 }
61
62 save() {
63- echo -n $"Saving $desc ($prog): "
64+ echo -n "Saving $desc ($prog): "
65 __EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1
66
67 if [ $RETVAL -eq 0 ]; then
68- success "$prog saved"
69+ echo "$prog saved"
70 else
71- failure "$prog saved"
72+ echo "$prog is not saved"
73 fi
74- echo
75 }
76
77 case "$1" in
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch
new file mode 100644
index 000000000..f332658bc
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch
@@ -0,0 +1,37 @@
1From cd312bc0e3686404428878d23b8888cba09a20e1 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 18 Sep 2014 19:46:58 -0700
4Subject: [PATCH] arptables.sysv: remove bashism
5
6Use "." to replace of "source", and change /bin/bash to /bin/sh, the
7echo $"foo" works well in busybox.
8
9Upstream-Status: Pending
10
11Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
12---
13 arptables.sysv | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/arptables.sysv b/arptables.sysv
17index 7a90bd2..7710376 100644
18--- a/arptables.sysv
19+++ b/arptables.sysv
20@@ -1,4 +1,4 @@
21-#!/bin/bash
22+#!/bin/sh
23 #
24 # init script for arptables
25 #
26@@ -11,7 +11,7 @@
27 #
28 # config: __SYSCONFIG__/arptables
29
30-source /etc/init.d/functions
31+. /etc/init.d/functions
32 # source /etc/sysconfig/network
33
34 # Check that networking is up.
35--
361.7.9.5
37
diff --git a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
new file mode 100644
index 000000000..41a55c027
--- /dev/null
+++ b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb
@@ -0,0 +1,34 @@
1SUMMARY = "Administration tool for arp packet filtering"
2PRIORITY = "optional"
3LICENSE = "GPL-2.0"
4SECTION = "console/network"
5
6PR = "r2"
7
8RDEPENDS_${PN} += "perl"
9
10LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
11SRC_URI = " \
12 ${SOURCEFORGE_MIRROR}/ebtables/arptables-v${PV}.tar.gz;name=arptables \
13 file://arptables-compile-install.patch \
14 file://arptables-init-busybox.patch \
15 file://arptables-arpt-get-target-fix.patch \
16 file://arptables-remove-bashism.patch \
17"
18SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5"
19SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928"
20
21S = "${WORKDIR}/arptables-v${PV}"
22
23do_compile () {
24 oe_runmake
25}
26
27# the install target is not multi-job safe, but it doesn't do much
28# so we just install serially
29#
30PARALLEL_MAKEINST = "-j1"
31
32fakeroot do_install () {
33 oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install
34}