Package init
This commit is contained in:
commit
044869457a
10
bridge-utils-1.0.4-inc.patch
Normal file
10
bridge-utils-1.0.4-inc.patch
Normal file
@ -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 <linux/sockios.h>
|
||||
+#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/if_bridge.h>
|
||||
33
bridge-utils-1.6-add-missing-sys-time.patch
Normal file
33
bridge-utils-1.6-add-missing-sys-time.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From b69811c054a55c241ce5628a32a62486eab491e5 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksander@aleksander.es>
|
||||
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 <aleksander@aleksander.es>
|
||||
---
|
||||
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 <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
+#include <sys/time.h>
|
||||
#include <netinet/in.h>
|
||||
+
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_bridge.h>
|
||||
|
||||
--
|
||||
cgit v1.1
|
||||
|
||||
38
bridge-utils-1.6-fix-signed-unsigned-warnings.patch
Normal file
38
bridge-utils-1.6-fix-signed-unsigned-warnings.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From 42c1aefc303fdf891fbb099ea51f00dca83ab606 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
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 <stephen@networkplumber.org>
|
||||
---
|
||||
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
|
||||
|
||||
BIN
bridge-utils-1.6.tar.sign
Normal file
BIN
bridge-utils-1.6.tar.sign
Normal file
Binary file not shown.
BIN
bridge-utils-1.6.tar.xz
Normal file
BIN
bridge-utils-1.6.tar.xz
Normal file
Binary file not shown.
11
bridge-utils-libbridge-cflags.patch
Normal file
11
bridge-utils-libbridge-cflags.patch
Normal file
@ -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@
|
||||
46
bridge-utils.spec
Normal file
46
bridge-utils.spec
Normal file
@ -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 <zhaolei746@huawei.com> - 1.6-3
|
||||
- Package init
|
||||
18
bugfix-avoid-showmacs-memory-leak.patch
Normal file
18
bugfix-avoid-showmacs-memory-leak.patch
Normal file
@ -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;
|
||||
}
|
||||
|
||||
44
bugfix-bridge-not-check-parameters.patch
Normal file
44
bugfix-bridge-not-check-parameters.patch
Normal file
@ -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)
|
||||
Loading…
x
Reference in New Issue
Block a user