| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This patch adds makefiles to build this open source tool
on Android. This patch also addresses some compatibilty
issues between GNU C and bionic C implementation.
Change-Id: Ic35ab4f98d5f252d53e92c6cde43f0673cef9d4a
|
|
|
|
| |
Add helper function to check write to sysfs files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Don't just die with SEGV if fopen fails.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|