summaryrefslogtreecommitdiff
path: root/bridge.c
Commit message (Collapse)AuthorAgeFilesLines
* bridge: allow setting hash_max valueLinus Lüssing2015-05-271-0/+6
| | | | | | | | | | | | If the number of entries in the MDB exceeds hash_max then the multicast snooping capabilities of the bridge are disabled automatically. The default value for hash_max is 512 which is already exceeded by some wireless community mesh networks. They need to be able to set a higher value. Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
* device: remove DEV_ATTR_IFNAME, it is unusedFelix Fietkau2015-04-171-1/+1
| | | | | | | Ensures that interfaces with only 'ifname' matching the device config don't cause iface->device_config to be set Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: allow enabling or disabling the multicast querier independently of ↵Matthias Schiffer2015-03-231-1/+7
| | | | | | | | | | | | | | IGMP snooping In larger networks, especially big batman-adv meshes, it may be desirable to enable IGMP snooping on every bridge without enabling the multicast querier to specifically put the querier on a well-connected node. This patch adds a new UCI option 'multicast_querier' for bridges which allows this. The default is still the value of the 'igmp_snooping' option to maintain backwards compatiblity. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* netifd: Keep reference to a config copy in device type specific reload ↵Hans Dedecker2015-02-171-0/+3
| | | | | | | | | handler as the original config pointer might go stale Fixes random observed crashes in blobmsg_parse when device type specific config data is parsed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* bridge: fix retrying member enable when the bridge is otherwise emptyFelix Fietkau2015-01-231-8/+40
| | | | | | Ensure that the bridge gets created before retrying Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: mark tested members as present during enable retryFelix Fietkau2015-01-231-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: release failed member devicesFelix Fietkau2015-01-231-0/+2
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: retry adding members after config reload / device startFelix Fietkau2014-11-231-0/+36
| | | | | | | | The kernel will refuse to add a vlan device to a bridge when the base device of that vlan is already a member. This can happen on config reload. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: enable IGMP snooping by defaultFelix Fietkau2014-07-171-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* netifd: Fix node version set after freeHans Dedecker2014-05-091-1/+5
| | | | | | | | | Fixes an issue where a bridge member will be removed from the bridge upon an interface ifup as the bridge node version -1 is overwritten by vlist_add while the new created bridge member pointer is freed in bridge_member_update Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Add interface config support to enable/disable IPv6 in the kernel ↵Hans Dedecker2014-04-261-0/+6
| | | | | | | | per device Main use case is being able to disable IPv6 on (a) WAN interface(s) when only IPv4 connectivity is offered or 6rd is used. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: Reload proto on topology changeHelmut Schaa2014-03-211-0/+4
| | | | | | | | | | Introduce a new device event "topology change" that gets signaled by bridges on adding/removing members. On "topology changes" the proto handlers are requested to "renew" which is most useful for DHCP. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
* netifd: Fix bridge MTU setting when a bridge member is addedHans Dedecker2014-03-111-2/+9
| | | | | | Reapply bridge mtu setting as adding a bridge member will override the bridge mtu in the kernel Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* netifd: fix bridge reloading issueEmanuel Taube2014-03-071-2/+2
| | | | | | | Check in the right order to decide if the bridge have to be set up. Additionally we are consistent with setting it down. Signed-off-by: Emanuel Taube <emanuel.taube@gmail.com>
* netifd: Fix possible segfault in bridge codeHelmut Schaa2013-11-291-0/+3
| | | | | | Need to check calloc result. In case of failure the bridge member will be missing. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
* bridge: fix stray semicolon, fixes a bug in bridge primary port resetFelix Fietkau2013-10-291-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: fix corner case with network reloadLuka Perkov2013-08-291-5/+4
| | | | | | | | After removing all ifname options from bridge interface and executing network reload the configuration was not applied properly on the system. With this change that is no longer a issue. Signed-off-by: Luka Perkov <luka@openwrt.org>
* bridge: add bridge_empty option which allows creation of empty bridgesLuka Perkov2013-07-131-0/+14
| | | | Signed-off-by: Luka Perkov <luka@openwrt.org>
* config: use the new uci_blob library codeFelix Fietkau2013-06-101-4/+4
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* bridge: disable multicast snooping by defaultJo-Philipp Wich2013-04-271-3/+1
|
* set default bridge priority to 0x7FFFJo-Philipp Wich2013-04-231-3/+2
|
* add bridge priority optionNiels Boehm2013-04-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | [netifd] add bridge priority option Using the bridge priority (lower numbers are higher in the hierarchy), one can ensure that the router is chosen as root bridge in a setup with spanning tree protocol. For instance, one can set the priority of network lan to 32767, causing the router to win over all directly and indirectly connected nodes that have a default priority of 32768. The reason for doing that is that otherwise it has a default priority 32768 as well and any other connected node could win and get root bridge. In a home setup, those nodes are often desktop or laptop boxes and get switched off from time to time. As a consequence, root bridges vanish or new root bridges get chosen relatively often, resulting in frequent topology changes to the STP network. While the new topology has not settled, packets can get lost, causing noticeable interruptions of network traffic. Setting the router's bridge on a lower numbered priority (and thus higher in the selection hierarchy) solves the problem in the vast majority of the cases by ensuring that the device that is most likely powered on 24/7 gets chosen as root and prevents topology changes. Signed-off-by: Niels Boehm <blubberdiblub@gmail.com>
* bridge: toggle device present state after freeing a bridge member to ensure ↵Felix Fietkau2012-10-191-3/+24
| | | | that it can be reassigned to a different bridge
* bridge: fix getting the mac address from the first member deviceFelix Fietkau2012-06-271-1/+7
|
* bridge: keep existing mac address if specified in the configFelix Fietkau2012-05-241-0/+5
|
* bridge: set the mac address based on the first active memberFelix Fietkau2012-05-231-0/+22
|
* add copyright headersFelix Fietkau2012-05-041-0/+13
|
* move device cleanup to common code, fixes use-after-free in tunnel codeFelix Fietkau2012-03-191-1/+0
|
* bridge: turn stp off by defaultFelix Fietkau2012-03-051-1/+1
|
* bridge: increase the default forward delay to 2 seconds (minimum enforced by ↵Felix Fietkau2012-03-051-1/+1
| | | | the kernel)
* bridge: fix removal of present bridge membersFelix Fietkau2012-03-051-2/+3
|
* bridge: implement config reload support, preserves hotplug interfaces and ↵Felix Fietkau2012-03-051-6/+55
| | | | adds fast updates for adding/removing bridge members
* bridge: add a debug message when a device could not be addedFelix Fietkau2012-03-051-1/+3
|
* bridge: fix hotplug device removalFelix Fietkau2012-03-041-4/+4
|
* bridge: fix member list handlingFelix Fietkau2012-03-041-8/+19
|
* remove redundant variable assignmentFelix Fietkau2012-03-041-4/+0
|
* bridge: use vlist instead of listFelix Fietkau2012-03-041-30/+38
|
* export carrier status in device statsFelix Fietkau2012-01-191-0/+1
|
* add a hotplug op for preparing an interface bridge so that it's ready when ↵Felix Fietkau2011-11-041-3/+18
| | | | an external process adds interfaces
* bridge: fix cleanup path, avoid double free on hotplug device removeFelix Fietkau2011-11-041-16/+22
|
* fix handling bridge interfaces with no initial deviceFelix Fietkau2011-10-231-3/+4
|
* fix initial bridge member bringupFelix Fietkau2011-10-211-2/+2
|
* fix duplicate bridge addifFelix Fietkau2011-10-211-3/+0
|
* rework device hotplug handling some more, add device_lock/device_unlock to ↵Felix Fietkau2011-10-191-3/+8
| | | | prevent use-after-free bugs
* set the igmp snooping option for bridgesFelix Fietkau2011-10-191-0/+6
|
* directly pass the device name to the device create functionFelix Fietkau2011-10-181-8/+2
|
* implement a new ubus object "network.device", add a method for dumping ↵Felix Fietkau2011-10-111-3/+3
| | | | detailed device information
* add more options for bridges, enable stp by default and set forwarding delay ↵Felix Fietkau2011-10-091-1/+43
| | | | to 1
* rename a variable for clarityFelix Fietkau2011-10-051-6/+18
|
* bridge: add missing device cleanupFelix Fietkau2011-10-031-0/+1
|