Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
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>
|
|
Minor errors in man page.
Reported-by: Adam Simeth <adamsimeth@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
No further functional changes planned.
Critical bug fixes only.
Update mailing list address
|
|
The term enslave is not appropriate in this context.
|
|
The TODO is over 10 years old, and is irrelevant at this point.
|
|
If built with warning enabled, Gcc would complain about
comparison of signed with unsigned.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
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>
|
|
When compiling bridge-utils, the CFLAGS set during "configure" were only
used in the brctl directory. Set for libbridge as well.
|
|
|
|
The brctl command has been replaced by bridge.
|
|
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>
|
|
- 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
|
|
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>
|
|
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>
|
|
Signed-off-by: Andrey Mazo <mazo@telum.ru>
|
|
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>
|
|
Want to do full distribution style test
|
|
update .gitignore to ignore autoconf stuff and binary
|
|
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>
|
|
|
|
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>
|
|
One missing space reported by A. Costa and always captialize
Linux.
|
|
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.
|
|
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>
|
|
Add helper function to check write to sysfs files.
|
|
Debian bug 406907
Error message was refering to incorrect command argument.
|
|
Command is "setageing" not "setageingtime"; fix man page.
Debian bug report.
|
|
No longer uses sourceforge.
|
|
|
|
|
|
|
|
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>
|
|
If utility has some new attribute, that is not in older kernel,
just assume it is zero.
|
|
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.
|
|
Don't just die with SEGV if fopen fails.
|
|
Need to do autoconf correctly, bah on Lennart.
|
|
Resolve some problems with make install
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
|
|
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>
|
|
other headers.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
|
|
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>
|
|
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
|
|
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
|
|
|
|
was more trouble than it was worth, the code is easier if
just using directories directory.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
|
|
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
|
|
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>
|
|
This reverts 39af7c8f2855c3d9cb44e3069cbfeddd8979acae commit.
Better to add this functionality via ebtables rather than
into bridging code.
|
|
|
|
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.
|
|
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348617
|
|
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=296881
|
|
|
|
|
|
|
|
|
|
|
|
of libsysfs
|
|
|
|
|
|
|
|
|
|
|
|
from API, and display output.
Fix foreach_port for case when /sys is missing (but compiled for sysfs).
|
|
|
|
|
|
|
|
|
|
|
|
get port info arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Update make system to build with or without sysfs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Don't read port and bridge info automatically, add a new
API hook to do that.
Version 0.9.8
|
|
- cleanup dependicies
- allow 4k ports
- don't fetch info till needed.
|
|
|
|
- error checking
- handle upto 1000's of bridges
- -V version
- don't initialize bridge till have to.
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for people with older glibc's.
|
|
|
|
|
|
Handle ELOOP return condition from br_add_bridge.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spec file update
|
|
|
|
|
|
|
|
|
|
Bring docs somewhat more up-to-date.
|
|
|
|
|