commit 044869457a1d5bdb031d7181aeb84bb1895a387f Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:33:09 2019 -0400 Package init diff --git a/bridge-utils-1.0.4-inc.patch b/bridge-utils-1.0.4-inc.patch new file mode 100644 index 0000000..1ae3f5b --- /dev/null +++ b/bridge-utils-1.0.4-inc.patch @@ -0,0 +1,10 @@ +--- bridge-utils-1.0.4/libbridge/libbridge_private.h~ 2004-05-28 21:38:38.000000000 +0100 ++++ bridge-utils-1.0.4/libbridge/libbridge_private.h 2004-07-01 11:24:21.000000000 +0100 +@@ -22,6 +22,7 @@ + #include "config.h" + + #include ++#include + #include + #include + #include diff --git a/bridge-utils-1.6-add-missing-sys-time.patch b/bridge-utils-1.6-add-missing-sys-time.patch new file mode 100644 index 0000000..c4ce4aa --- /dev/null +++ b/bridge-utils-1.6-add-missing-sys-time.patch @@ -0,0 +1,33 @@ +From b69811c054a55c241ce5628a32a62486eab491e5 Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Mon, 17 Jul 2017 17:21:38 -0700 +Subject: libbridge: add missing sys/time.h include in header Required to + define the 'struct timeval' type: + + In file included from external/bridge-utils/brctl/brctl.c:25: + external/bridge-utils/brctl/../libbridge/libbridge.h:44:17: error: field has incomplete type 'struct timeval' + struct timeval max_age; + ^ + +Signed-off-by: Aleksander Morgado +--- + libbridge/libbridge.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h +index ff047f9..c038b92 100644 +--- a/libbridge/libbridge.h ++++ b/libbridge/libbridge.h +@@ -21,7 +21,9 @@ + + #include + #include ++#include + #include ++ + #include + #include + +-- +cgit v1.1 + diff --git a/bridge-utils-1.6-fix-signed-unsigned-warnings.patch b/bridge-utils-1.6-fix-signed-unsigned-warnings.patch new file mode 100644 index 0000000..f08efec --- /dev/null +++ b/bridge-utils-1.6-fix-signed-unsigned-warnings.patch @@ -0,0 +1,38 @@ +From 42c1aefc303fdf891fbb099ea51f00dca83ab606 Mon Sep 17 00:00:00 2001 +From: Stephen Hemminger +Date: Mon, 17 Jul 2017 17:23:56 -0700 +Subject: brctl: fix signed/unsigned comparison warnings + +If built with warning enabled, Gcc would complain about +comparison of signed with unsigned. + +Signed-off-by: Stephen Hemminger +--- + brctl/brctl_cmd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c +index 5f12e6f..acd66be 100644 +--- a/brctl/brctl_cmd.c ++++ b/brctl/brctl_cmd.c +@@ -483,7 +483,7 @@ static const struct command commands[] = { + + const struct command *command_lookup(const char *cmd) + { +- int i; ++ unsigned int i; + + for (i = 0; i < sizeof(commands)/sizeof(commands[0]); i++) { + if (!strcmp(cmd, commands[i].name)) +@@ -495,7 +495,7 @@ const struct command *command_lookup(const char *cmd) + + void command_helpall(void) + { +- int i; ++ unsigned int i; + + for (i = 0; i < sizeof(commands)/sizeof(commands[0]); i++) { + printf("\t%-10s\t%s\n", commands[i].name, commands[i].help); +-- +cgit v1.1 + diff --git a/bridge-utils-1.6.tar.sign b/bridge-utils-1.6.tar.sign new file mode 100644 index 0000000..0915716 Binary files /dev/null and b/bridge-utils-1.6.tar.sign differ diff --git a/bridge-utils-1.6.tar.xz b/bridge-utils-1.6.tar.xz new file mode 100644 index 0000000..8956998 Binary files /dev/null and b/bridge-utils-1.6.tar.xz differ diff --git a/bridge-utils-libbridge-cflags.patch b/bridge-utils-libbridge-cflags.patch new file mode 100644 index 0000000..50bb27a --- /dev/null +++ b/bridge-utils-libbridge-cflags.patch @@ -0,0 +1,11 @@ +--- bridge-utils-1.5/libbridge/Makefile.in.orig 2015-07-21 13:09:20.270079468 +0100 ++++ bridge-utils-1.5/libbridge/Makefile.in 2015-07-21 13:09:39.382036853 +0100 +@@ -5,7 +5,7 @@ + RANLIB=@RANLIB@ + + CC=@CC@ +-CFLAGS = -Wall -g $(KERNEL_HEADERS) ++CFLAGS = @CFLAGS@ -g $(KERNEL_HEADERS) + + prefix=@prefix@ + exec_prefix=@exec_prefix@ diff --git a/bridge-utils.spec b/bridge-utils.spec new file mode 100644 index 0000000..b8aa8fd --- /dev/null +++ b/bridge-utils.spec @@ -0,0 +1,46 @@ +Summary: Utilities for configuring the linux ethernet bridge +Name: bridge-utils +Version: 1.6 +Release: 3 +License: GPLv2+ +URL: https://wiki.linuxfoundation.org/networking/bridge +Source0: https://www.kernel.org/pub/linux/utils/net/%{name}/%{name}-%{version}.tar.xz +Source1: https://www.kernel.org/pub/linux/utils/net/%{name}/%{name}-%{version}.tar.sign +#The following four patches come from fedoraproject +Patch0000: bridge-utils-1.0.4-inc.patch +Patch0001: bridge-utils-libbridge-cflags.patch +Patch0002: bridge-utils-1.6-add-missing-sys-time.patch +Patch0003: bridge-utils-1.6-fix-signed-unsigned-warnings.patch + +Patch9000: bugfix-bridge-not-check-parameters.patch +Patch9001: bugfix-avoid-showmacs-memory-leak.patch +BuildRequires: libsysfs-devel autoconf automake libtool +BuildRequires: kernel-headers >= 2.6.16 + +%description +This package provides utilities for configuring the linux ethernet +bridge. The linux ethernet bridge can be used for connecting multiple +ethernet devices together. + + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +autoconf +%configure +%make_build + +%install +%make_install SUBDIRS="brctl doc" + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc AUTHORS doc/FAQ doc/HOWTO +%{_sbindir}/brctl +%{_mandir}/man8/brctl.8* + +%changelog +* Wed Sep 18 2019 Alex Chao - 1.6-3 +- Package init diff --git a/bugfix-avoid-showmacs-memory-leak.patch b/bugfix-avoid-showmacs-memory-leak.patch new file mode 100644 index 0000000..a9698c9 --- /dev/null +++ b/bugfix-avoid-showmacs-memory-leak.patch @@ -0,0 +1,18 @@ +--- a/brctl/brctl_cmd.c 2019-05-08 16:09:02.744000000 +0800 ++++ b/brctl/brctl_cmd.c 2019-05-08 17:40:07.252000000 +0800 +@@ -407,6 +407,7 @@ + if (n < 0) { + fprintf(stderr, "read of forward table failed: %s\n", + strerror(errno)); ++ free(fdb); + return 1; + } + +@@ -426,6 +427,7 @@ + br_show_timer(&f->ageing_timer_value); + printf("\n"); + } ++ free(fdb); + return 0; + } + diff --git a/bugfix-bridge-not-check-parameters.patch b/bugfix-bridge-not-check-parameters.patch new file mode 100644 index 0000000..b16473f --- /dev/null +++ b/bugfix-bridge-not-check-parameters.patch @@ -0,0 +1,44 @@ +diff -Nur bridge-utils-1.5-old/brctl/brctl_cmd.c bridge-utils-1.5/brctl/brctl_cmd.c +--- bridge-utils-1.5-old/brctl/brctl_cmd.c 2018-05-17 07:03:02.868000000 -0400 ++++ bridge-utils-1.5/brctl/brctl_cmd.c 2018-05-17 07:07:26.023000000 -0400 +@@ -250,11 +250,20 @@ + static int br_cmd_setpathcost(int argc, char *const* argv) + { + int cost, err; ++ int temp=0; + + if (sscanf(argv[3], "%i", &cost) != 1) { + fprintf(stderr, "bad path cost value\n"); + return 1; + } ++ while(*(argv[3]+temp)){ ++ if(*(argv[3]+temp)<'0'||*(argv[3]+temp)>(9+'0')){ ++ fprintf(stderr, "bad path cost value\n"); ++ return 1; ++ } ++ temp++; ++ } ++ + + err = br_set_path_cost(argv[1], argv[2], cost); + if (err) +@@ -266,11 +275,19 @@ + static int br_cmd_setportprio(int argc, char *const* argv) + { + int cost, err; ++ int temp=0; + + if (sscanf(argv[3], "%i", &cost) != 1) { + fprintf(stderr, "bad path priority value\n"); + return 1; + } ++ while(*(argv[3]+temp)){ ++ if(*(argv[3]+temp)<'0'||*(argv[3]+temp)>(9+'0')){ ++ fprintf(stderr, "bad path priority value\n"); ++ return 1; ++ } ++ temp++; ++ } + + err = br_set_port_priority(argv[1], argv[2], cost); + if (err)