Hello community, here is the log from the commit of package bridge-utils for openSUSE:Factory checked in at 2016-10-20 23:09:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bridge-utils (Old) and /work/SRC/openSUSE:Factory/.bridge-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bridge-utils" Changes: -------- --- /work/SRC/openSUSE:Factory/bridge-utils/bridge-utils.changes 2015-12-09 22:13:11.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.bridge-utils.new/bridge-utils.changes 2016-10-20 23:09:57.000000000 +0200 @@ -1,0 +2,7 @@ +Tue Oct 18 14:06:26 UTC 2016 - tchva...@suse.com + +- Version update to 1.6: + * Various tiny fixes, nothing ground breaking +- Refresh patch bridge-utils-1.5-ip6.patch (fuzz) + +------------------------------------------------------------------- Old: ---- bridge-utils-1.5.tar.gz New: ---- bridge-utils-1.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bridge-utils.spec ++++++ --- /var/tmp/diff_new_pack.VXMNg0/_old 2016-10-20 23:09:58.000000000 +0200 +++ /var/tmp/diff_new_pack.VXMNg0/_new 2016-10-20 23:09:58.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package bridge-utils # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,15 +17,15 @@ Name: bridge-utils -Version: 1.5 +Version: 1.6 Release: 0 Summary: Utilities for Configuring the Linux Ethernet Bridge License: GPL-2.0+ Group: Productivity/Networking/Routing Url: http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge -Source: http://downloads.sourceforge.net/project/bridge/bridge/%{name}-%{version}.tar.gz -Patch0: %{name}-%{version}-hz.diff -Patch1: %{name}-%{version}-optflags.patch +Source: http://www.kernel.org/pub/linux/utils/net/bridge-utils/%{name}-%{version}.tar.gz +Patch0: %{name}-1.5-hz.diff +Patch1: %{name}-1.5-optflags.patch Patch2: bridge-utils-1.5-ip6.patch BuildRequires: automake BuildRequires: libsysfs ++++++ bridge-utils-1.5-ip6.patch ++++++ --- /var/tmp/diff_new_pack.VXMNg0/_old 2016-10-20 23:09:58.000000000 +0200 +++ /var/tmp/diff_new_pack.VXMNg0/_new 2016-10-20 23:09:58.000000000 +0200 @@ -2,9 +2,9 @@ =================================================================== --- libbridge/libbridge.h.orig +++ libbridge/libbridge.h -@@ -21,6 +21,7 @@ - +@@ -23,6 +23,7 @@ #include <sys/socket.h> + #include <netinet/in.h> #include <linux/if.h> +#include <linux/in6.h> #include <linux/if_bridge.h> ++++++ bridge-utils-1.5.tar.gz -> bridge-utils-1.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/.gitignore new/bridge-utils-1.6/.gitignore --- old/bridge-utils-1.5/.gitignore 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/.gitignore 2016-10-13 01:30:02.000000000 +0200 @@ -33,3 +33,5 @@ *.orig *.rej +autom4te.cache/ +brctl/brctl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/AUTHORS new/bridge-utils-1.6/AUTHORS --- old/bridge-utils-1.5/AUTHORS 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/AUTHORS 2016-10-13 01:30:02.000000000 +0200 @@ -1,2 +1,2 @@ -Stephen Hemminger <shemmin...@vyatta.com> +Stephen Hemminger <step...@networkplumber.org> Lennert Buytenhek <buyt...@gnu.org> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/Makefile.in new/bridge-utils-1.6/Makefile.in --- old/bridge-utils-1.5/Makefile.in 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/Makefile.in 2016-10-13 01:30:02.000000000 +0200 @@ -14,22 +14,19 @@ SUBDIRS=libbridge brctl doc all: - for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x ; done + for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x || exit 1 ; done clean: for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x clean ; done distclean: clean - rm -f config.log - rm -f config.cache - rm -f config.status + rm -f config.* maintainer-clean: distclean - rm -f Makefile - rm -f brctl/Makefile - rm -f libbridge/Makefile - rm -f doc/Makefile + rm -f configure Makefile bridge-utils.spec + rm -fr autom4te.cache + rm -f brctl/Makefile libbridge/Makefile doc/Makefile install: - for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x install; done + for x in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$x install || exit 1 ; done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/brctl/brctl.c new/bridge-utils-1.6/brctl/brctl.c --- old/bridge-utils-1.5/brctl/brctl.c 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/brctl/brctl.c 2016-10-13 01:30:02.000000000 +0200 @@ -19,7 +19,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/errno.h> +#include <errno.h> #include <getopt.h> #include "libbridge.h" @@ -69,7 +69,7 @@ argc -= optind; argv += optind; if ((cmd = command_lookup(*argv)) == NULL) { - fprintf(stderr, "never heard of command [%s]\n", argv[1]); + fprintf(stderr, "never heard of command [%s]\n", *argv); goto help; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/brctl/brctl_cmd.c new/bridge-utils-1.6/brctl/brctl_cmd.c --- old/bridge-utils-1.5/brctl/brctl_cmd.c 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/brctl/brctl_cmd.c 2016-10-13 01:30:02.000000000 +0200 @@ -305,30 +305,41 @@ static int br_cmd_showstp(int argc, char *const* argv) { struct bridge_info info; + const char *name = argv[1]; + + if (br_get_bridge_info(name, &info)) { + if (errno == ENODEV) + fprintf(stderr, "bridge %s does not exist!\n", name); + else + fprintf(stderr, "device %s is not a bridge!\n", name); - if (br_get_bridge_info(argv[1], &info)) { - fprintf(stderr, "%s: can't get info %s\n", argv[1], - strerror(errno)); return 1; } - br_dump_info(argv[1], &info); + br_dump_info(name, &info); return 0; } static int show_bridge(const char *name, void *arg) { struct bridge_info info; - - printf("%s\t\t", name); - fflush(stdout); + static int show_header = 1; if (br_get_bridge_info(name, &info)) { - fprintf(stderr, "can't get info %s\n", - strerror(errno)); + if (errno == ENODEV) + fprintf(stderr, "bridge %s does not exist!\n", name); + else + fprintf(stderr, "device %s is not a bridge!\n", name); + return 1; } + if (show_header) { + printf("bridge name\tbridge id\t\tSTP enabled\tinterfaces\n"); + show_header = 0; + } + + printf("%s\t\t", name); br_dump_bridge_id((unsigned char *)&info.bridge_id); printf("\t%s\t\t", info.stp_enabled?"yes":"no"); @@ -338,16 +349,15 @@ static int br_cmd_show(int argc, char *const* argv) { - int i; + int i, errs = 0; - printf("bridge name\tbridge id\t\tSTP enabled\tinterfaces\n"); if (argc == 1) br_foreach_bridge(show_bridge, NULL); else for(i = 2; i <= argc; i++) - show_bridge(argv[i - 1], NULL); + errs += show_bridge(argv[i - 1], NULL); - return 0; + return errs > 0; } static int compare_fdbs(const void *_f0, const void *_f1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/configure.ac new/bridge-utils-1.6/configure.ac --- old/bridge-utils-1.5/configure.ac 1970-01-01 01:00:00.000000000 +0100 +++ new/bridge-utils-1.6/configure.ac 2016-10-13 01:30:02.000000000 +0200 @@ -0,0 +1,31 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT([bridge-utils],[1.6]) +AC_CONFIG_HEADERS(libbridge/config.h) + +AC_ARG_WITH([linux-headers], + [AS_HELP_STRING([--with-linux-headers], [location of the linux headers to use])], + [KERNEL_HEADERS=$withval], + [KERNEL_HEADERS="/usr/src/linux/include"] +) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_RANLIB + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(sys/ioctl.h sys/time.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_HEADER_TIME + +dnl Checks for library functions. +AC_CHECK_FUNCS(gethostname socket strdup uname) +AC_CHECK_FUNCS(if_nametoindex if_indextoname) + +AC_SUBST(KERNEL_HEADERS) + +AC_CONFIG_FILES([doc/Makefile libbridge/Makefile brctl/Makefile Makefile bridge-utils.spec]) +AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/configure.in new/bridge-utils-1.6/configure.in --- old/bridge-utils-1.5/configure.in 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/configure.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(bridge-utils, 1.5) -AC_CONFIG_HEADERS(libbridge/config.h) - -AC_ARG_WITH( linux-headers, [ --with-linux-headers Location of the linux headers to use], - KERNEL_HEADERS=$withval, KERNEL_HEADERS="/usr/src/linux/include") - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_RANLIB - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(sys/ioctl.h sys/time.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_HEADER_TIME - -dnl Checks for library functions. -AC_CHECK_FUNCS(gethostname socket strdup uname) -AC_CHECK_FUNCS(if_nametoindex if_indextoname) - -AC_SUBST(KERNEL_HEADERS) - -AC_OUTPUT(doc/Makefile libbridge/Makefile brctl/Makefile Makefile bridge-utils.spec) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/doc/Makefile.in new/bridge-utils-1.6/doc/Makefile.in --- old/bridge-utils-1.5/doc/Makefile.in 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/doc/Makefile.in 2016-10-13 01:30:02.000000000 +0200 @@ -10,8 +10,6 @@ sbindir=@sbindir@ mandir=@mandir@ -SUBDIRS=libbridge brctl - all: clean: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/doc/brctl.8 new/bridge-utils-1.6/doc/brctl.8 --- old/bridge-utils-1.5/doc/brctl.8 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/doc/brctl.8 2016-10-13 01:30:02.000000000 +0200 @@ -22,7 +22,7 @@ .SH DESCRIPTION .B brctl is used to set up, maintain, and inspect the ethernet bridge -configuration in the linux kernel. +configuration in the Linux kernel. An ethernet bridge is a device commonly used to connect different networks of ethernets together, so that these ethernets will appear as @@ -89,7 +89,7 @@ .B brctl showmacs <brname> shows a list of learned MAC addresses for this bridge. -.B brctl setageingtime <brname> <time> +.B brctl setageing <brname> <time> sets the ethernet (MAC) address ageing time, in seconds. After <time> seconds of not having seen a frame coming from a certain address, the bridge will time out (delete) that address from the Forwarding @@ -106,15 +106,15 @@ networks of ethernets using the IEEE 802.1d spanning tree protocol. This protocol is used for finding the shortest path between two ethernets, and for eliminating loops from the topology. As this -protocol is a standard, linux bridges will interwork properly with -other third party bridge products. Bridges communicate with eachother +protocol is a standard, Linux bridges will interwork properly with +other third party bridge products. Bridges communicate with each other by sending and receiving BPDUs (Bridge Protocol Data Units). These BPDUs can be recognised by an ethernet destination address of 01:80:c2:00:00:00. The spanning tree protocol can also be turned off (for those situations where it just doesn't make sense, for example when this -linux box is the only bridge on the LAN, or when you know that there +Linux box is the only bridge on the LAN, or when you know that there are no loops in the topology.) .IR brctl(8) @@ -159,14 +159,19 @@ dimension. This metric is used in the designated port and root port selection algorithms. - .SH NOTES .BR brctl(8) -replaces the older brcfg tool. +is obsolete. Some features such as STP guard, harpin mode, fastleave and root +block are intentionally not implemented in this command. +Instead use +.B bridge +command from +.B iproute2 +package for a more full set of features. .SH SEE ALSO -.BR ipchains(8), .BR iptables(8) .SH AUTHOR Lennert Buytenhek <buyt...@gnu.org> +Stephen Hemminger <step...@networkplumber.org> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/libbridge/libbridge.h new/bridge-utils-1.6/libbridge/libbridge.h --- old/bridge-utils-1.5/libbridge/libbridge.h 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/libbridge/libbridge.h 2016-10-13 01:30:02.000000000 +0200 @@ -19,7 +19,9 @@ #ifndef _LIBBRIDGE_H #define _LIBBRIDGE_H +#include <sys/types.h> #include <sys/socket.h> +#include <netinet/in.h> #include <linux/if.h> #include <linux/if_bridge.h> @@ -45,7 +47,7 @@ struct timeval bridge_max_age; struct timeval bridge_hello_time; struct timeval bridge_forward_delay; - u_int16_t root_port; + uint16_t root_port; unsigned char stp_enabled; unsigned char topology_change; unsigned char topology_change_detected; @@ -58,8 +60,8 @@ struct fdb_entry { - u_int8_t mac_addr[6]; - u_int16_t port_no; + uint8_t mac_addr[6]; + uint16_t port_no; unsigned char is_local; struct timeval ageing_timer_value; }; @@ -69,9 +71,9 @@ unsigned port_no; struct bridge_id designated_root; struct bridge_id designated_bridge; - u_int16_t port_id; - u_int16_t designated_port; - u_int8_t priority; + uint16_t port_id; + uint16_t designated_port; + uint8_t priority; unsigned char top_change_ack; unsigned char config_pending; unsigned char state; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/libbridge/libbridge_devif.c new/bridge-utils-1.6/libbridge/libbridge_devif.c --- old/bridge-utils-1.5/libbridge/libbridge_devif.c 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/libbridge/libbridge_devif.c 2016-10-13 01:30:02.000000000 +0200 @@ -23,7 +23,7 @@ #include <errno.h> #include <string.h> #include <dirent.h> -#include <sys/fcntl.h> +#include <fcntl.h> #include "libbridge.h" #include "libbridge_private.h" @@ -280,25 +280,38 @@ return old_get_port_info(brname, port, info); } +static int set_sysfs(const char *path, unsigned long value) +{ + int fd, ret = 0, cc; + char buf[32]; + + fd = open(path, O_WRONLY); + if (fd < 0) + return -1; + + cc = snprintf(buf, sizeof(buf), "%lu\n", value); + if (write(fd, buf, cc) < 0) + ret = -1; + close(fd); + + return ret; +} + static int br_set(const char *bridge, const char *name, unsigned long value, unsigned long oldcode) { int ret; char path[SYSFS_PATH_MAX]; - FILE *f; - snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name); + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge/%s", + bridge, name); - f = fopen(path, "w"); - if (f) { - ret = fprintf(f, "%ld\n", value); - fclose(f); - } else { + if ((ret = set_sysfs(path, value)) < 0) { /* fallback to old ioctl */ struct ifreq ifr; unsigned long args[4] = { oldcode, value, 0, 0 }; - + strncpy(ifr.ifr_name, bridge, IFNAMSIZ); ifr.ifr_data = (char *) &args; ret = ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr); @@ -348,14 +361,10 @@ { int ret; char path[SYSFS_PATH_MAX]; - FILE *f; snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brport/%s", ifname, name); - f = fopen(path, "w"); - if (f) { - ret = fprintf(f, "%ld\n", value); - fclose(f); - } else { + + if ((ret = set_sysfs(path, value)) < 0) { int index = get_portno(bridge, ifname); if (index < 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/libbridge/libbridge_if.c new/bridge-utils-1.6/libbridge/libbridge_if.c --- old/bridge-utils-1.5/libbridge/libbridge_if.c 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/libbridge/libbridge_if.c 2016-10-13 01:30:02.000000000 +0200 @@ -20,7 +20,7 @@ #include <stdlib.h> #include <errno.h> #include <string.h> -#include <sys/fcntl.h> +#include <fcntl.h> #include <sys/ioctl.h> #include "libbridge.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bridge-utils-1.5/libbridge/libbridge_init.c new/bridge-utils-1.6/libbridge/libbridge_init.c --- old/bridge-utils-1.5/libbridge/libbridge_init.c 2011-03-29 02:52:54.000000000 +0200 +++ new/bridge-utils-1.6/libbridge/libbridge_init.c 2016-10-13 01:30:02.000000000 +0200 @@ -48,13 +48,24 @@ { char path[SYSFS_PATH_MAX]; struct stat st; + int ret, saved_errno; - if (entry->d_name[0] == '.') + if (entry->d_name[0] == '.' + && (entry->d_name[1] == '\0' + || (entry->d_name[1] == '.' + && entry->d_name[2] == '\0'))) return 0; - + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge", entry->d_name); - return stat(path, &st) == 0 && S_ISDIR(st.st_mode); + + /* Workaround old glibc breakage. + If errno is set, then it fails scandir! */ + saved_errno = errno; + ret = (stat(path, &st) == 0 && S_ISDIR(st.st_mode)); + errno = saved_errno; + + return ret; } /*