aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2022-01-07cleanup includesmainStephen Hemminger7-13/+11
Use IWYU to only include necessary headers. Should resolve build issues for distros that need limits.h to find PATH_MAX. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2021-03-04Chnage version to 1.7v1.7.1Stephen Hemminger1-1/+1
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2021-03-04fix string overflow warningsStephen Hemminger6-15/+42
Gcc 10 now gives warnings about possible string overflow and non-null terminated strings. Resolve these by introducing strlcpy() and expanding the size of some path string buffers. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2021-01-25brctl: fix spelling on man pageStephen Hemminger1-2/+2
Minor errors in man page. Reported-by: Adam Simeth <adamsimeth@gmail.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-06-23README: mark bridge-utils as deprecatedv1.7Stephen Hemminger1-11/+7
No further functional changes planned. Critical bug fixes only. Update mailing list address
2020-06-23Replace references to enslaveStephen Hemminger3-5/+5
The term enslave is not appropriate in this context.
2020-06-23Remove out of date TODOStephen Hemminger1-30/+0
The TODO is over 10 years old, and is irrelevant at this point.
2017-07-17brctl: fix signed/unsigned comparison warningsStephen Hemminger1-2/+2
If built with warning enabled, Gcc would complain about comparison of signed with unsigned. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-17libbridge: add missing sys/time.h include in headerAleksander Morgado1-0/+2
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>
2017-05-15libbridge: Include the configured CFLAGS when compilingDavid Michael1-1/+1
When compiling bridge-utils, the CFLAGS set during "configure" were only used in the brctl directory. Set for libbridge as well.
2016-10-12bridge-utils 1.6 releasev1.6Stephen Hemminger1-1/+1
2016-10-12man: add obsolete notice to man pageStephen Hemminger1-3/+8
The brctl command has been replaced by bridge.
2016-08-17brctl: better error handlingStephen Hemminger1-13/+23
When calling brctl show with incorrect device name, the error handling was quite confusing. Before: $ brctl show nosuchdev bridge name bridge id STP enabled interfaces nosuchdev can't get info No such device After: $ brctl show nosuchdev bridge nosuchdev does not exist! $ brctl show eth0 device eth0 is not a bridge! Reported-by: Olaf Bohlen <olaf.bohlen@ewe.de>
2016-08-17Fix building on musl libcKylie McClain4-9/+10
- Silence warnings: errno.h is defined by POSIX, sys/errno.h is a glibcism, same with fcntl.h vs. sys/fcntl.h - Use standard types rather than _GNU_SOURCE-exposed types u_int16_t -> uint16_t u_int8_t -> uint8_t
2014-02-28bridge-utils: Pretty print configure helpAndrey Mazo1-2/+5
Use special AS_HELP_STRING() macro to correctly format configure --help output. Before the change: """ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-linux-headers Location of the linux headers to use """ After the change: """ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-linux-headers location of the linux headers to use """ Signed-off-by: Andrey Mazo <mazo@telum.ru>
2014-02-28bridge-utils: AC_OUTPUT should be used without argumentsAndrey Mazo1-2/+3
This patch is a result of autoupdate-2.69 run and fixes the following warning: configure.ac:27: warning: AC_OUTPUT should be used without arguments. configure.ac:27: You should run autoupdate. Signed-off-by: Andrey Mazo <mazo@telum.ru>
2014-02-28bridge-utils: Remove unused variable in doc/Makefile.inAndrey Mazo1-2/+0
Signed-off-by: Andrey Mazo <mazo@telum.ru>
2014-02-28bridge-utils: Abort compilation on error in any subdirectoryAndrey Mazo1-2/+2
Currently bridge-utils makefile ignores compilation errors in subdirectories, stepping into consecutive subdirs and finally returning exit status of the last subdirectory's make. The last subdirectory is now "doc", which has nothing to do for target "all", so global `make all` always succeeds, effectively ignoring any build errors in "libbridge" and "brctl" subdirectories. This behaviour is odd as it breaks anyone relying on make's exit status. For example, see Gentoo bug #483692 [1]. Fix this by simply aborting make on the first error. Don't inspect MAKEFLAGS for -k for simplicity. [1] https://bugs.gentoo.org/show_bug.cgi?id=483692 Signed-off-by: Andrey Mazo <mazo@telum.ru>
2013-03-20Clean up autoconf debris when doing make maintainer-cleanStephen Hemminger1-7/+4
Want to do full distribution style test
2013-03-20ignore build filesStephen Hemminger1-0/+2
update .gitignore to ignore autoconf stuff and binary
2013-03-20rename configure.in to configure.acYegor Yefremov1-0/+0
Automake 1.14 will likely drop support for the long-deprecated 'configure.in' name for the Autoconf input file. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2013-03-07update email addressStephen Hemminger1-1/+1
2013-03-07bridge-utils: Fix compile against linux-3.8.xRussell Senior1-0/+1
Linux 3.8 has a header, include/uapi/linux/if_bridge.h that uses a struct in6_addr but doesn't define it. The trivial seeming fix of including the header that does define it causes more problems. The problem was discussed on mailing lists in January 2013. The final suggestion I found was here: http://www.redhat.com/archives/libvir-list/2013-January/msg01253.html This is intended to implement that suggestion. Signed-off-by: Russell Senior <russell@personaltelco.net>
2012-08-13Fix typo's on man pageStephen Hemminger1-4/+4
One missing space reported by A. Costa and always captialize Linux.
2011-10-04bug with older glibc: "brctl show" shows nothingDavid Johnson1-1/+9
Older glibc has a bug in scandir() where if the last call to filter is a failure and filter sets errno, scandir() will fail and return that errno to the caller. If running "brctl show" on a system where the last (sorted) directory in /sys/class/net is not a bridge, isbridge() will leave errno set to ENOENT and trigger this bug in glibc. Attached patch against bridge-utils v1.5 saves/restores errno in isbridge() to workaround this bug in older glibc.
2011-09-12skip . and .. in accurately in isbridge()Xiaochen Wang1-2/+5
Hi all, In commit f88f8 "Skip . and .. in foreach_bridge test", the code skips all directories starting with dot. But if we create a bridge staring with dot, e.g. `.br0`, then `brctl show` cannot show this one. `.br0` should not be hidden, because we cannot find it except the command `brctl show .br0`. Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
2011-05-03Check error returns from write to sysfsStephen Hemminger1-14/+23
Add helper function to check write to sysfs files.
2011-05-03Fix error message for incorrect commandStephen Hemminger1-1/+1
Debian bug 406907 Error message was refering to incorrect command argument.
2011-05-03Fix incorrect command in manualStephen Hemminger1-1/+1
Command is "setageing" not "setageingtime"; fix man page. Debian bug report.
2011-03-28Update URL of git repositoryv1.5Stephen Hemminger5-27/+84
No longer uses sourceforge.
2011-03-28update mailing addressStephen Hemminger2-4/+2
2011-03-28bridge-utils 1.5Stephen Hemminger1-1/+1
2011-01-13show selected bridgeAnton Danilov1-2/+10
2010-01-15bridge-utils: Add 'hairpin' port forwarding modeFischer, Anna4-0/+51
This patch adds a 'hairpin' (also called 'reflective relay') mode port configuration to the Linux Ethernet bridge utilities. A bridge supporting hairpin forwarding mode can send frames back out through the port the frame was received on. Hairpin mode is required to support basic VEPA (Virtual Ethernet Port Aggregator) capabilities. You can find additional information on VEPA here: http://tech.groups.yahoo.com/group/evb/ http://www.ieee802.org/1/files/public/docs2009/new-hudson-vepa_seminar-20090514d.pdf http://www.internet2.edu/presentations/jt2009jul/20090719-congdon.pdf (I simplified the code by handling option compatiablity in earlier patch -- Stephen) Signed-off-by: Paul Congdon <paul.congdon@hp.com> Signed-off-by: Anna Fischer <anna.fischer@hp.com>
2010-01-15Handle unknown attributes more gracefullyStephen Hemminger1-5/+4
If utility has some new attribute, that is not in older kernel, just assume it is zero.
2009-03-02Skip . and .. in foreach_bridge testStephen Hemminger1-1/+5
If bridge is name 'bridge' then the test for ./bridge would succeed and eventually cause a SEGV. Correct fix is to just skip . directories in scan.
2009-03-02Check for fopen() failingStephen Hemminger1-5/+9
Don't just die with SEGV if fopen fails.
2008-01-29use proper version of install in doc/MakefileStephen Hemminger1-1/+1
Need to do autoconf correctly, bah on Lennart.
2008-01-29don't install libbridge.aStephen Hemminger2-6/+3
Resolve some problems with make install Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
2008-01-08fix use of sysfs (affects 32/64 bit compat)v1.4Denys Vlasenko1-1/+7
I built current git head of bridge-utils. 32-bit binary omn 64-bit kernel doesn't show bridged interfaces: bridge name bridge id STP enabled interfaces br0 8000.000000000000 no can't get port info: Operation not supported It turns out that it uses wrong directory name and falls back to using ioctls. Bridge ioctls seems to be deprecated and 32/64 compat is missing, thus it fails. Attached patch makes brctl use /sys/class/net/br0/brif instead of nonexistent /sys/class/net/br0/brport: /sys/class/net/br0 ... ... ./brif: lrwxrwxrwx 1 root root 0 Jan 8 10:54 eth0 -> ../../../../class/net/eth0/brport Please apply. -- Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
2007-11-26Use linux/if.h rather than net/if.h for compatiablity withv1.3Stephen Hemminger1-1/+7
other headers. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-10-29Allow bridge-utils to run when no TCP/IP is availableAlon Bar-Lev1-1/+1
This simple patch create AF_LOCAL socket instead of AF_INET so if TCP/IP is not linked into kernel it still works. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-10-29Update gitignoreStephen Hemminger1-4/+32
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-05-08I've noticed for a while thatJeremy Jackson1-1/+1
output is showing 0 for port_no and port_id It seems that somewhere in 2.6 sysfs land the following items got printed in hexadecimal, and brctl code was parsing for decimal only doug:/sys/class/net/eth0/brport# cat port_id 0x8001 doug:/sys/class/net/eth0/brport# cat port_no 0x1
2007-03-21Add ignore for generated files.Stephen Hemminger2-0/+9
2006-09-08Get rid of bridge-utils dependency on libsysfs. The libraryv1.2Stephen Hemminger5-292/+136
was more trouble than it was worth, the code is easier if just using directories directory. Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-09-08Change the autoconf stuff to handle newer versions of autoconfStephen Hemminger3-4/+3
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-28patch for a message bugSantiago Garcia Mantinan1-3/+5
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 <shemminger@osdl.org>
2006-08-04Revert "Add support for bridge port forwarding."Stephen Hemminger3-101/+0
This reverts 39af7c8f2855c3d9cb44e3069cbfeddd8979acae commit. Better to add this functionality via ebtables rather than into bridging code.
2006-07-20Add support for bridge port forwarding.Stephen Hemminger3-0/+101
2006-07-11http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376914Marco Nenciarini1-6/+0
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.
2006-07-11If addif fails report whether bridge or interface doesn't exist.Stephen Hemminger1-1/+4
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348617
2006-07-11Minor manpage typoStephen Hemminger1-1/+1
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=296881
2006-05-31Fix bug where changing port priority changed path cost instead.Stephen Hemminger2-1/+5
2006-02-01Fix bugs with new sysfsutils library interfacev1.1shemminger3-29/+34
2006-01-31More fixes for sysfs 2.0 code.shemminger1-18/+18
2006-01-31Fix up new sysfs code.shemminger1-1/+1
2006-01-31Update for v1.1shemminger1-4/+4
2006-01-31Update bridge utils to support new sysfsutils 2.0 versionshemminger4-147/+141
of libsysfs
2005-03-16Fix sysfs detection to include -lsysfsv1.0.6shemminger1-2/+3
2005-03-16Fix sysfs detection to work on Suseshemminger1-5/+5
2005-03-161,0.6 fix sysfs detection and allow multiple interfaces for add/delshemminger3-35/+71
2004-12-021.0.5 updatesv1.0.5shemminger10-274/+84
2004-06-08Add port_no back to port_infov1.0.4shemminger3-4/+7
2004-06-04Get rid of all visible signs of port number and ifindexv1.0.4-rc3shemminger6-166/+161
from API, and display output. Fix foreach_port for case when /sys is missing (but compiled for sysfs).
2004-06-03Workaround older libraries with buste if_indextoname etc.v1.0.4-rc2shemminger2-6/+34
2004-06-02Error handling, and build cleanupv1.0.4-rc1shemminger4-8/+21
2004-06-02Makefile is built by autoconfshemminger1-21/+0
2004-06-01Fix libraries on older systems (no lsysfs).shemminger2-11/+4
2004-05-28Fix set_port parameter values (more ifindex confustion).v1.0.3shemminger3-11/+41
2004-05-28Fix problems relating to ifindex vs. index in theshemminger4-36/+19
get port info arguments.
2004-05-271.0.2 - fix get_port_info, confusion about bridge name vs port name.v1.0.2shemminger4-18/+39
2004-05-27Fix issues found testing on earlier 2.6 systemsv1.0.1shemminger6-11/+21
2004-05-25typo on changelog datev1.0shemminger1-1/+1
2004-05-25Allow LDFLAGS, add URL to specshemminger2-1/+7
2004-05-24Update ChangeLogshemminger1-0/+16
2004-05-24Add config.h.inChangeLogshemminger1-0/+11
2004-05-24Put tests in CVSshemminger7-0/+308
2004-05-21New version of command and library that use sysfs.shemminger14-659/+941
Update make system to build with or without sysfs.
2004-05-11Fix install to work with RPM... Finally.shemminger2-2/+12
2004-05-11Cleanup old directoryshemminger3-117/+0
2004-05-11Fix for RPM buildshemminger1-4/+3
2004-05-11More build fixesshemminger1-1/+1
2004-05-11More build fixesshemminger1-1/+1
2004-05-11Fix RPM buildshemminger1-2/+4
2004-05-11Change spec for 1.0shemminger1-11/+2
2004-05-11Change to 1.0shemminger2-6/+6
2004-05-11Update for 1.0. Use new ioct interface.shemminger5-304/+10
2004-04-13Support for 1000's of ports on bridge.v0.9.8shemminger6-78/+120
Don't read port and bridge info automatically, add a new API hook to do that. Version 0.9.8
2004-04-07Changes for 0.9.8shemminger10-154/+135
- cleanup dependicies - allow 4k ports - don't fetch info till needed.
2004-04-01Missed one file in last merge. this adds const to brctl_dispv0.9.7shemminger1-8/+8
2004-04-01Fixes for 0.9.7shemminger12-203/+221
- error checking - handle upto 1000's of bridges - -V version - don't initialize bridge till have to.
2003-05-09From: John Naylon <jbpn@cambridgebroadband.com>shemminger1-0/+1
Please find attached a patch which fixes a minor bug in libbridge. This only affects long-running processes that may call br_refresh() multiple times, i.e. it doesn't affect brctl but may affect brctld, although I have not seen this myself (I discovered the bug while working on another process that links against libbridge). Basically, if you call br_refresh() when there are one or more bridges up, take all bridges down and call br_refresh() again, and finally call br_refresh() once more, your process will probably seg fault because bridge_list is not NULL, but points at previously-free()d memory on the third call.
2003-04-25When stress testing and devices disappear, it is possibleshemminger1-21/+12
to have races where the index that was found is gone. Manage this by ignoring disappeared devices when the initial port table is built up.
2003-04-25In case of race and EAGAIN error, retry in the library.shemminger1-3/+9
2003-04-25add and del bridge functions can take 'const char *'shemminger2-5/+5
2003-04-25read_info and port are only used in one function so can be static.shemminger1-2/+0
2003-04-25If read of bridge forwarding table fails, then print error and exit.shemminger1-0/+5
2002-10-02Release 0.9.6.buytenh3-2/+6
2002-04-03autoconfization by Andreas Hofmeisterbuytenh11-72/+457
2002-04-03Release 0.9.5.buytenh1-1/+1
2002-01-16And make make clean work again.buytenh1-1/+0
2002-01-16Typo :(buytenh1-1/+1
2002-01-16Work around sparc64 brokenness some more.buytenh3-8/+10
2002-01-16Get rid of rcsclean and rm -f *~ shit.buytenh2-4/+0
2002-01-16Work around sparc64 brokenness.buytenh4-16/+72
2002-01-060.9.3 -> 0.9.4buytenh1-2/+2
2002-01-06Update for 0.9.4.buytenh1-0/+20
2002-01-06Try to work around sparc64 braindamage.buytenh3-5/+14
2002-01-06Remove references to 'tap'.buytenh1-4/+1
2002-01-06Steal .spec file from Red Hat rawhide.buytenh1-20/+24
2001-12-31Added comment from Serge Caron on how to build libbridge_compat.cbuytenh1-0/+16
for people with older glibc's.
2001-12-25Add notice about kernel panic on REDIRECT w/o IP address case.buytenh1-0/+1
2001-12-10Remove some completed items.buytenh1-5/+0
2001-12-07Check if correct number of arguments given to an option.buytenh3-19/+31
Handle ELOOP return condition from br_add_bridge.
2001-12-07Kill two compile warnings.buytenh1-2/+2
2001-11-17Removed 'tap'; people really should be using vtund for this.buytenh3-168/+1
2001-11-17misc. modificationsbuytenh1-5/+2
2001-11-17MASQUERADE tested to work.buytenh1-1/+0
2001-11-07more TODO itemsbuytenh1-0/+5
2001-11-07updatebuytenh1-22/+13
2001-11-07arghbuytenh1-0/+2
2001-11-07move TODO file and update itbuytenh2-20/+48
2001-11-07add missing ChangeLog entries for the 0.9.3 releasebuytenh1-0/+8
2001-11-07add out-of-date notice to the THANKS filebuytenh3-2/+11
spec file update
2001-11-07obsoletebuytenh1-56/+0
2001-11-07update for 2.4 firewallingbuytenh3-29/+38
2001-11-07FAQ now located at sourceforgebuytenh1-78/+2
2001-06-22Compressed man page for building on RH71.v0.9.3buytenh1-1/+1
2001-06-22Remove references to openrock.buytenh7-23/+12
Bring docs somewhat more up-to-date.
2001-06-22Fix 42.94 second wrap buglet.buytenh1-4/+4
2001-06-22Initial revisionbuytenh37-0/+3262