aboutsummaryrefslogtreecommitdiffstats
path: root/libbridge/libbridge_devif.c
Commit message (Collapse)AuthorAgeFilesLines
* brctl: Add Android makefiles to build on AndroidNiranjan Pendharkar2013-02-081-1/+4
| | | | | | | | 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
* Check error returns from write to sysfsStephen Hemminger2011-05-031-14/+23
| | | | Add helper function to check write to sysfs files.
* bridge-utils: Add 'hairpin' port forwarding modeFischer, Anna2010-01-151-0/+8
| | | | | | | | | | | | | | | | | | | | | 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>
* Handle unknown attributes more gracefullyStephen Hemminger2010-01-151-5/+4
| | | | | If utility has some new attribute, that is not in older kernel, just assume it is zero.
* Check for fopen() failingStephen Hemminger2009-03-021-5/+9
| | | | Don't just die with SEGV if fopen fails.
* I've noticed for a while thatJeremy Jackson2007-05-081-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
* Get rid of bridge-utils dependency on libsysfs. The libraryStephen Hemminger2006-09-081-174/+101
| | | | | | | was more trouble than it was worth, the code is easier if just using directories directory. Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
* http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376914Marco Nenciarini2006-07-111-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.
* Fix bugs with new sysfsutils library interfaceshemminger2006-02-011-19/+20
|
* More fixes for sysfs 2.0 code.shemminger2006-01-311-18/+18
|
* Fix up new sysfs code.shemminger2006-01-311-1/+1
|
* Update bridge utils to support new sysfsutils 2.0 versionshemminger2006-01-311-131/+126
| | | | of libsysfs
* Add port_no back to port_infoshemminger2004-06-081-0/+2
|
* Get rid of all visible signs of port number and ifindexshemminger2004-06-041-102/+70
| | | | | | from API, and display output. Fix foreach_port for case when /sys is missing (but compiled for sysfs).
* Workaround older libraries with buste if_indextoname etc.shemminger2004-06-031-2/+12
|
* Fix set_port parameter values (more ifindex confustion).shemminger2004-05-281-6/+36
|
* Fix problems relating to ifindex vs. index in theshemminger2004-05-281-18/+10
| | | | get port info arguments.
* 1.0.2 - fix get_port_info, confusion about bridge name vs port name.shemminger2004-05-271-13/+33
|
* Fix issues found testing on earlier 2.6 systemsshemminger2004-05-271-3/+3
|
* New version of command and library that use sysfs.shemminger2004-05-211-85/+392
| | | | Update make system to build with or without sysfs.
* Fix RPM buildshemminger2004-05-111-2/+4
|
* Update for 1.0. Use new ioct interface.shemminger2004-05-111-1/+9
|
* Support for 1000's of ports on bridge.shemminger2004-04-131-50/+0
| | | | | | | Don't read port and bridge info automatically, add a new API hook to do that. Version 0.9.8
* Changes for 0.9.8shemminger2004-04-071-6/+53
| | | | | | - cleanup dependicies - allow 4k ports - don't fetch info till needed.
* Fixes for 0.9.7shemminger2004-04-011-31/+3
| | | | | | | - error checking - handle upto 1000's of bridges - -V version - don't initialize bridge till have to.
* In case of race and EAGAIN error, retry in the library.shemminger2003-04-251-3/+9
|
* Typo :(buytenh2002-01-161-1/+1
|
* Work around sparc64 brokenness some more.buytenh2002-01-161-4/+4
|
* Work around sparc64 brokenness.buytenh2002-01-161-4/+32
|
* Try to work around sparc64 braindamage.buytenh2002-01-061-3/+3
|
* Initial revisionbuytenh2001-06-221-0/+170