summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/bridge-utils
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/bridge-utils')
-rw-r--r--meta-networking/recipes-support/bridge-utils/bridge-utils.inc28
-rw-r--r--meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch87
-rw-r--r--meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch33
-rw-r--r--meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch33
-rw-r--r--meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch22
-rw-r--r--meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb11
6 files changed, 214 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils.inc b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc
new file mode 100644
index 000000000..feeba7435
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc
@@ -0,0 +1,28 @@
1SUMMARY = "Tools for ethernet bridging"
2HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"
3SECTION = "console/network"
4LICENSE = "GPLv2"
5
6DEPENDS = "sysfsutils"
7
8SRC_URI = "${SOURCEFORGE_MIRROR}/bridge/bridge-utils-${PV}.tar.gz \
9 file://bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch \
10 file://bridge-utils-1.5-fix-error-message-for-incorrect-command.patch \
11 file://bridge-utils-1.5-fix-incorrect-command-in-manual.patch \
12"
13
14inherit autotools-brokensep update-alternatives
15
16ALTERNATIVE_${PN} = "brctl"
17ALTERNATIVE_PRIORITY[brctl] = "100"
18ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl"
19
20EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
21
22do_install_append () {
23 install -d ${D}/${datadir}/bridge-utils
24 install -d ${D}/${sysconfdir}/network/if-pre-up.d
25 install -d ${D}/${sysconfdir}/network/if-post-down.d
26}
27
28RRECOMMENDS_${PN} = "kernel-module-bridge"
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
new file mode 100644
index 000000000..d00af9c15
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
@@ -0,0 +1,87 @@
1Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
2
3Signed-off-by: Roy.Li <rongqing.li@windriver.com>
4
5From bb9970a9df95837e39d680021b1f73d231e85406 Mon Sep 17 00:00:00 2001
6From: Stephen Hemminger <shemminger@vyatta.com>
7Date: Tue, 3 May 2011 09:52:43 -0700
8Subject: [PATCH 3/3] Check error returns from write to sysfs
9
10Add helper function to check write to sysfs files.
11
12Signed-off-by: Petr Sabata <contyk@redhat.com>
13---
14 libbridge/libbridge_devif.c | 37 +++++++++++++++++++++++--------------
15 1 files changed, 23 insertions(+), 14 deletions(-)
16
17diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c
18index aa8bc36..1e83925 100644
19--- a/libbridge/libbridge_devif.c
20+++ b/libbridge/libbridge_devif.c
21@@ -280,25 +280,38 @@ fallback:
22 return old_get_port_info(brname, port, info);
23 }
24
25+static int set_sysfs(const char *path, unsigned long value)
26+{
27+ int fd, ret = 0, cc;
28+ char buf[32];
29+
30+ fd = open(path, O_WRONLY);
31+ if (fd < 0)
32+ return -1;
33+
34+ cc = snprintf(buf, sizeof(buf), "%lu\n", value);
35+ if (write(fd, buf, cc) < 0)
36+ ret = -1;
37+ close(fd);
38+
39+ return ret;
40+}
41+
42
43 static int br_set(const char *bridge, const char *name,
44 unsigned long value, unsigned long oldcode)
45 {
46 int ret;
47 char path[SYSFS_PATH_MAX];
48- FILE *f;
49
50- snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name);
51+ snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge/%s",
52+ bridge, name);
53
54- f = fopen(path, "w");
55- if (f) {
56- ret = fprintf(f, "%ld\n", value);
57- fclose(f);
58- } else {
59+ if ((ret = set_sysfs(path, value)) < 0) {
60 /* fallback to old ioctl */
61 struct ifreq ifr;
62 unsigned long args[4] = { oldcode, value, 0, 0 };
63-
64+
65 strncpy(ifr.ifr_name, bridge, IFNAMSIZ);
66 ifr.ifr_data = (char *) &args;
67 ret = ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr);
68@@ -348,14 +361,10 @@ static int port_set(const char *bridge, const char *ifname,
69 {
70 int ret;
71 char path[SYSFS_PATH_MAX];
72- FILE *f;
73
74 snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brport/%s", ifname, name);
75- f = fopen(path, "w");
76- if (f) {
77- ret = fprintf(f, "%ld\n", value);
78- fclose(f);
79- } else {
80+
81+ if ((ret = set_sysfs(path, value)) < 0) {
82 int index = get_portno(bridge, ifname);
83
84 if (index < 0)
85--
861.7.5.2
87
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
new file mode 100644
index 000000000..2d0494e53
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch
@@ -0,0 +1,33 @@
1Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
2
3Signed-off-by: Roy.Li <rongqing.li@windriver.com>
4
5From c7ed0996ef58b497d3d30be802ab5ae6c37099b5 Mon Sep 17 00:00:00 2001
6From: Stephen Hemminger <shemminger@vyatta.com>
7Date: Tue, 3 May 2011 09:49:57 -0700
8Subject: [PATCH 2/3] Fix error message for incorrect command
9
10Debian bug 406907
11Error message was refering to incorrect command argument.
12
13Signed-off-by: Petr Sabata <contyk@redhat.com>
14---
15 brctl/brctl.c | 2 +-
16 1 files changed, 1 insertions(+), 1 deletions(-)
17
18diff --git a/brctl/brctl.c b/brctl/brctl.c
19index 454b8dd..46ca352 100644
20--- a/brctl/brctl.c
21+++ b/brctl/brctl.c
22@@ -69,7 +69,7 @@ int main(int argc, char *const* argv)
23 argc -= optind;
24 argv += optind;
25 if ((cmd = command_lookup(*argv)) == NULL) {
26- fprintf(stderr, "never heard of command [%s]\n", argv[1]);
27+ fprintf(stderr, "never heard of command [%s]\n", *argv);
28 goto help;
29 }
30
31--
321.7.5.2
33
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
new file mode 100644
index 000000000..6f6d6d423
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch
@@ -0,0 +1,33 @@
1Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-incorrect-command-in-manual.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08]
2
3Signed-off-by: Roy.Li <rongqing.li@windriver.com>
4
5From 8ef7b77562b636efcbd8b759eb324d6c069200f2 Mon Sep 17 00:00:00 2001
6From: Stephen Hemminger <shemminger@vyatta.com>
7Date: Tue, 3 May 2011 09:48:40 -0700
8Subject: [PATCH 1/3] Fix incorrect command in manual
9
10Command is "setageing" not "setageingtime"; fix man page.
11Debian bug report.
12
13Signed-off-by: Petr Sabata <contyk@redhat.com>
14---
15 doc/brctl.8 | 2 +-
16 1 files changed, 1 insertions(+), 1 deletions(-)
17
18diff --git a/doc/brctl.8 b/doc/brctl.8
19index d904047..771f323 100644
20--- a/doc/brctl.8
21+++ b/doc/brctl.8
22@@ -89,7 +89,7 @@ data. Machines can move to other ports, network cards can be replaced
23 .B brctl showmacs <brname>
24 shows a list of learned MAC addresses for this bridge.
25
26-.B brctl setageingtime <brname> <time>
27+.B brctl setageing <brname> <time>
28 sets the ethernet (MAC) address ageing time, in seconds. After <time>
29 seconds of not having seen a frame coming from a certain address, the
30 bridge will time out (delete) that address from the Forwarding
31--
321.7.5.2
33
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
new file mode 100644
index 000000000..de36f0598
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
@@ -0,0 +1,22 @@
1include missing kernel header
2
3Fixes errors like
4
5| /b/kraj/jlinux-next/poky/build/tmp-eglibc/sysroots/re-64b/usr/include/linux/if_bridge.h:172:20: error: field 'ip6' has incomplete type
6| In file included from ../libbridge/libbridge.h:24:0,
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10
11Index: bridge-utils-1.5/libbridge/libbridge.h
12===================================================================
13--- bridge-utils-1.5.orig/libbridge/libbridge.h 2011-03-28 17:52:54.000000000 -0700
14+++ bridge-utils-1.5/libbridge/libbridge.h 2013-03-04 21:16:25.781188309 -0800
15@@ -20,6 +20,7 @@
16 #define _LIBBRIDGE_H
17
18 #include <sys/socket.h>
19+#include <linux/in6.h>
20 #include <linux/if.h>
21 #include <linux/if_bridge.h>
22
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
new file mode 100644
index 000000000..04f863b22
--- /dev/null
+++ b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb
@@ -0,0 +1,11 @@
1require bridge-utils.inc
2
3SRC_URI += "file://kernel-headers.patch"
4
5PARALLEL_MAKE = ""
6
7LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37"
8
9SRC_URI[md5sum] = "ec7b381160b340648dede58c31bb2238"
10SRC_URI[sha256sum] = "42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688"
11