diff --git a/.cvsignore b/.cvsignore index 3cbf1b4..5696630 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -bridge-utils-1.1.tar.gz +bridge-utils-1.2.tar.gz diff --git a/bridge-utils-1.1-itsits.patch b/bridge-utils-1.1-itsits.patch deleted file mode 100644 index 866c8e6..0000000 --- a/bridge-utils-1.1-itsits.patch +++ /dev/null @@ -1,20 +0,0 @@ -commit 13ef4638bb7b0f94120137f13d6c3b66eb6058f1 -Author: Stephen Hemminger -Date: Tue Jul 11 15:41:42 2006 -0700 - - Minor manpage typo - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=296881 - -diff --git a/doc/brctl.8 b/doc/brctl.8 -index ba65a41..d904047 100644 ---- a/doc/brctl.8 -+++ b/doc/brctl.8 -@@ -72,7 +72,7 @@ will detach the interface from - - The command - .B brctl show --will show some information on the bridge and it's attached ports. -+will show some information on the bridge and its attached ports. - - - .SH AGEING diff --git a/bridge-utils-1.1-message-2.patch b/bridge-utils-1.1-message-2.patch deleted file mode 100644 index 5ee0c3b..0000000 --- a/bridge-utils-1.1-message-2.patch +++ /dev/null @@ -1,49 +0,0 @@ -commit cf06742ec8fd4e7ac7d393ebe093839379aa3f46 -Author: Santiago Garcia Mantinan -Date: Sat Aug 26 19:41:28 2006 +0200 - - patch for a message bug - - Hi! - - Jens Seidel reported a bug to Debian about a wrong message on brctl, you can - see it at http://bugs.debian.org/383938, it is kind of the continuation of - the ENODEV bug #348617 that was already patched by Stephen on the git. - - I have applied the same solution that Stephen applied for the first one, - follows the patch against git plus a minor exclamation mark modification I - did so that all ENODEV messages were exclamative (Stephen patch had missed - that mark). - - Regards... - -- - Manty/BestiaTester -> http://manty.net - - Signed-off-by: Stephen Hemminger - -diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c -index a05d5b1..c93dd55 100644 ---- a/brctl/brctl_cmd.c -+++ b/brctl/brctl_cmd.c -@@ -99,7 +99,7 @@ static int br_cmd_addif(int argc, char * - if (if_nametoindex(ifname) == 0) - fprintf(stderr, "interface %s does not exist!\n", ifname); - else -- fprintf(stderr, "bridge %s does not exist\n", brname); -+ fprintf(stderr, "bridge %s does not exist!\n", brname); - break; - - case EBUSY: -@@ -139,8 +139,10 @@ static int br_cmd_delif(int argc, char * - continue; - - case ENODEV: -- fprintf(stderr, "interface %s does not exist!\n", -- ifname); -+ if (if_nametoindex(ifname) == 0) -+ fprintf(stderr, "interface %s does not exist!\n", ifname); -+ else -+ fprintf(stderr, "bridge %s does not exist!\n", brname); - break; - - case EINVAL: diff --git a/bridge-utils-1.1-message.patch b/bridge-utils-1.1-message.patch deleted file mode 100644 index 5f2d801..0000000 --- a/bridge-utils-1.1-message.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit 3f28faf1a984ae611bc37ff9b9cdd21071df771b -Author: Stephen Hemminger -Date: Tue Jul 11 16:02:37 2006 -0700 - - If addif fails report whether bridge or interface doesn't exist. - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348617 - -diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c -index 67aaad4..a05d5b1 100644 ---- a/brctl/brctl_cmd.c -+++ b/brctl/brctl_cmd.c -@@ -96,7 +96,10 @@ static int br_cmd_addif(int argc, char * - continue; - - case ENODEV: -- fprintf(stderr, "interface %s does not exist!\n", ifname); -+ if (if_nametoindex(ifname) == 0) -+ fprintf(stderr, "interface %s does not exist!\n", ifname); -+ else -+ fprintf(stderr, "bridge %s does not exist\n", brname); - break; - - case EBUSY: diff --git a/bridge-utils-1.1-setportprio.patch b/bridge-utils-1.1-setportprio.patch deleted file mode 100644 index 4618a68..0000000 --- a/bridge-utils-1.1-setportprio.patch +++ /dev/null @@ -1,31 +0,0 @@ -commit 32a43e993241ff53f3333c4533d135c4f6cead73 -Author: Stephen Hemminger -Date: Wed May 31 14:20:30 2006 -0700 - - Fix bug where changing port priority changed path cost instead. - -diff --git a/ChangeLog b/ChangeLog -index e31da93..435d2f5 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2006-05-31 Stephen Hemminger -+ -+ * Fixed bug where setting port priority set path cost instead -+ - 2006-01-31 Stephen Hemminger - - * Released bridge-utils 1.1 -diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c -index 6d0785e..67aaad4 100644 ---- a/brctl/brctl_cmd.c -+++ b/brctl/brctl_cmd.c -@@ -267,7 +267,7 @@ static int br_cmd_setportprio(int argc, - return 1; - } - -- err = br_set_path_cost(argv[1], argv[2], cost); -+ err = br_set_port_priority(argv[1], argv[2], cost); - if (err) - fprintf(stderr, "set port priority failed: %s\n", - strerror(errno)); diff --git a/bridge-utils-1.1-sysfs-close.patch b/bridge-utils-1.1-sysfs-close.patch deleted file mode 100644 index c1fd05f..0000000 --- a/bridge-utils-1.1-sysfs-close.patch +++ /dev/null @@ -1,133 +0,0 @@ -commit 4d480f55ae79cd3b3d1b2681a852e8317a23c977 -Author: Marco Nenciarini -Date: Tue Jul 11 16:08:40 2006 -0700 - - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376914 - - some libsysfs2 internal stucts are corrupted during execution of brctl - by unneeded and erroneous calls to sysfs_close_class_device() - - Long description of my troubles - - On my xen Dom0 with 5 bridges and many interfaces every brctl show - invocations fails with a strange error. - - bridge name bridge id STP enabled interfaces - xenbr0 8000.feffffffffff no vif1.0 - peth0 - vif0.0 - xenbr1 8000.feffffffffff no vif3.0 - vif2.0 - vif1.1 - peth1 - vif0.1 - xenbr2 8000.feffffffffff no vif1.2 - peth2 - vif0.2 - xenbr3 8000.feffffffffff no can't get port info: No such device - xenbr4 8000.feffffffffff no vif2.2 - peth4 - vif0.4 - - but xenbr3 was fully up and functional, as stated by the contents of - /sys/class/net/xenbr3 directory. - - Investigating with strace i've found that brctl give this error - because it is trying to read xenbr3 interfaces in - /sys/class/net/eth0/brif directory! - - ..... - lstat64("/sys/class/net/xenbr3/bridge/topology_change_detected", {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 - stat64("/sys/class/net/xenbr3/bridge/topology_change_detected", {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 - open("/sys/class/net/xenbr3/bridge/topology_change_detected", O_RDONLY) = 4 - read(4, "0\n", 4096) = 2 - close(4) = 0 - open("/sys/class/net/eth0/brif", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory) - ioctl(3, SIOCDEVPRIVATE, 0xafdec36c) = -1 ENODEV (No such device) - write(1, "8000.feffffffffff\tno\t\t can\'t get"..., 59) = 59 - lstat64("/sys/class/net/xenbr4/bridge", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 - write(1, "xenbr4\t\t", 8) = 8 - ..... - - after some gdb and documentation reading sessions i've discovered that - all calls to sysfs_close_class_device() in libbridge code are wrong, - because their arguments are pointers returned by sysfs_get_* - functions. This is explicitly forbidden by libsysfs documentation[1] - at 6.1.b and corrupt libsysfs internal structures freeing memory that - still being used. - - [1] /usr/share/doc/libsysfs-dev/libsysfs.txt.gz - - ..... - 6.1 Calling Conventions in Libsysfs - ----------------------------------- - - Libsysfs uses a simple API calling convention. APIs are classified to be - one of "open", "get", "close" types. The convention is as follows: - - a. All "open" APIs have a corresponding "close" API. - b. References obtained using "get" calls should not be closed - explicitly. - c. All "opened" references have to be closed with a call to - their corresponding "close" call. This takes care of - freeing structure references obtained with "get" calls. - ..... - - I have checked all other sysfs_close_* calls and they seem to be - correct. - - Attached patch removes the wrong call, so i can operate correctly on - my bridges. - -diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c -index d3052a1..3703f4b 100644 ---- a/libbridge/libbridge_devif.c -+++ b/libbridge/libbridge_devif.c -@@ -188,7 +188,6 @@ #ifdef HAVE_LIBSYSFS - snprintf(path, SYSFS_PATH_MAX, "%s/bridge", dev->path); - if (sysfs_path_is_dir(path)) { - dprintf("path '%s' is not a directory\n", path); -- sysfs_close_class_device(dev); - goto fallback; - } - -@@ -214,7 +213,6 @@ #ifdef HAVE_LIBSYSFS - info->topology_change = fetch_int(dev, BRIDGEATTR("topology_change")); - info->topology_change_detected = fetch_int(dev, - BRIDGEATTR("topology_change_detected")); -- sysfs_close_class_device(dev); - - return 0; - -@@ -287,7 +285,6 @@ #ifdef HAVE_LIBSYSFS - - snprintf(path, SYSFS_PATH_MAX, "%s/brport", dev->path); - if (sysfs_path_is_dir(path)) { -- sysfs_close_class_device(dev); - goto fallback; - } - -@@ -309,7 +306,6 @@ #ifdef HAVE_LIBSYSFS - &info->forward_delay_timer_value); - fetch_tv(dev, BRPORT("hold_timer"), - &info->hold_timer_value); -- sysfs_close_class_device(dev); - - return 0; - fallback: -@@ -339,7 +335,6 @@ #ifdef HAVE_LIBSYSFS - ret = sysfs_write_attribute(attr, buf, strlen(buf)); - sysfs_close_attribute(attr); - } -- sysfs_close_class_device(dev); - } else - #endif - { -@@ -411,7 +406,6 @@ #ifdef HAVE_LIBSYSFS - ret = sysfs_write_attribute(attr, buf, strlen(buf)); - sysfs_close_attribute(attr); - } -- sysfs_close_class_device(dev); - } else - #endif - { diff --git a/bridge-utils-1.2-show-ports.patch b/bridge-utils-1.2-show-ports.patch new file mode 100644 index 0000000..82ba521 --- /dev/null +++ b/bridge-utils-1.2-show-ports.patch @@ -0,0 +1,22 @@ +diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c +diff --git a/libbridge/libbridge_init.c b/libbridge/libbridge_init.c +index e2eab77..38b8a18 100644 +--- a/libbridge/libbridge_init.c ++++ b/libbridge/libbridge_init.c +@@ -186,12 +186,15 @@ int br_foreach_port(const char *brname, + struct dirent **namelist; + char path[SYSFS_PATH_MAX]; + +- snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brport", brname); ++ snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brif", brname); + count = scandir(path, &namelist, 0, alphasort); + if (count < 0) + return old_foreach_port(brname, iterator, arg); + + for (i = 0; i < count; i++) { ++ if (!strcmp(namelist[i]->d_name, ".") || ++ !strcmp(namelist[i]->d_name, "..")) ++ continue; + if (iterator(brname, namelist[i]->d_name, arg)) + break; + } diff --git a/bridge-utils.spec b/bridge-utils.spec index 7d9e812..6b4878d 100644 --- a/bridge-utils.spec +++ b/bridge-utils.spec @@ -1,20 +1,16 @@ Summary: Utilities for configuring the linux ethernet bridge Name: bridge-utils -Version: 1.1 -Release: 2%{?dist} +Version: 1.2 +Release: 1%{?dist} License: GPL URL: http://bridge.sourceforge.net/ Group: System Environment/Base Source: http://dl.sf.net/bridge/bridge-utils-%{version}.tar.gz Patch0: bridge-utils-1.0.4-inc.patch -Patch1: bridge-utils-1.1-setportprio.patch -Patch2: bridge-utils-1.1-itsits.patch -Patch3: bridge-utils-1.1-message.patch -Patch4: bridge-utils-1.1-sysfs-close.patch -Patch5: bridge-utils-1.1-message-2.patch +Patch1: bridge-utils-1.2-show-ports.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: libsysfs-devel +BuildRequires: libsysfs-devel autoconf BuildRequires: kernel-headers >= 2.6.16 %description @@ -31,12 +27,9 @@ Install bridge-utils if you want to use the linux ethernet bridge. %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %build +autoconf %configure make @@ -53,6 +46,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/brctl.8* %changelog +* Wed Aug 22 2007 David Woodhouse 1.2-1 +- Update to 1.2 + * Sat Sep 09 2006 David Woodhouse 1.1-2 - Fix setportprio command (#205810) - Other updates from bridge-utils git tree diff --git a/sources b/sources index 046499c..3105de1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -43bbd2a67b59cac3e15d545f8b51df68 bridge-utils-1.1.tar.gz +1e6cff57ac90d7ab984d9512fdd9f2dd bridge-utils-1.2.tar.gz