29 Jan, 2016

1 commit

  • When switchdev drivers process FDB notifications from the underlying
    device they resolve the netdev to which the entry points to and notify
    the bridge using the switchdev notifier.

    However, since the RTNL mutex is not held there is nothing preventing
    the netdev from disappearing in the middle, which will cause
    br_switchdev_event() to dereference a non-existing netdev.

    Make switchdev drivers hold the lock at the beginning of the
    notification processing session and release it once it ends, after
    notifying the bridge.

    Also, remove switchdev_mutex and fdb_lock, as they are no longer needed
    when RTNL mutex is held.

    Fixes: 03bf0c281234 ("switchdev: introduce switchdev notifier")
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     

13 May, 2015

1 commit


04 Mar, 2015

1 commit


18 Jan, 2015

1 commit


27 Sep, 2014

1 commit

  • Jesper reported that br_netfilter always registers the hooks since
    this is part of the bridge core. This harms performance for people that
    don't need this.

    This patch modularizes br_netfilter so it can be rmmod'ed, thus,
    the hooks can be unregistered. I think the bridge netfilter should have
    been a separated module since the beginning, Patrick agreed on that.

    Note that this is breaking compatibility for users that expect that
    bridge netfilter is going to be available after explicitly 'modprobe
    bridge' or via automatic load through brctl.

    However, the damage can be easily undone by modprobing br_netfilter.
    The bridge core also spots a message to provide a clue to people that
    didn't notice that this has been deprecated.

    On top of that, the plan is that nftables will not rely on this software
    layer, but integrate the connection tracking into the bridge layer to
    enable stateful filtering and NAT, which is was bridge netfilter users
    seem to require.

    This patch still keeps the fake_dst_ops in the bridge core, since this
    is required by when the bridge port is initialized. So we can safely
    modprobe/rmmod br_netfilter anytime.

    Signed-off-by: Pablo Neira Ayuso
    Acked-by: Florian Westphal

    Pablo Neira Ayuso
     

23 May, 2014

1 commit


14 Jan, 2014

1 commit


17 Dec, 2011

1 commit


05 Apr, 2011

1 commit

  • Add netlink device ops to allow creating bridge device via netlink.
    This works in a manner similar to vlan, macvlan and bonding.

    Example:
    # ip link add link dev br0 type bridge
    # ip link del dev br0

    The change required rearranging initializtion code to deal with
    being called by create link. Most of the initialization happens
    in br_dev_setup, but allocation of stats is done in ndo_init callback
    to deal with allocation failure. Sysfs setup has to wait until
    after the network device kobject is registered.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

16 Nov, 2010

1 commit


02 Jun, 2010

1 commit

  • What this patch does is it removes two receive frame hooks (for bridge and for
    macvlan) from __netif_receive_skb. These are replaced them with a single
    hook for both. It only supports one hook per device because it makes no
    sense to do bridging and macvlan on the same device.

    Then a network driver (of virtual netdev like macvlan or bridge) can register
    an rx_handler for needed net device.

    Signed-off-by: Jiri Pirko
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Jiri Pirko
     

16 May, 2010

1 commit


27 Jun, 2009

1 commit


12 Jun, 2009

1 commit

  • This patch changes FDB entry check for ATM LANE bridge integration.
    There's no point in holding a FDB entry around SKB building.

    br_fdb_get()/br_fdb_put() pair are changed into single br_fdb_test_addr()
    hook that checks if the addr has FDB entry pointing to other port
    to the one the request arrived on.

    FDB entry refcounting is removed as it's not used anywhere else.

    Signed-off-by: Michał Mirosław
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Michał Mirosław
     

09 Sep, 2008

1 commit


06 Jul, 2008

1 commit


12 Jun, 2008

1 commit


29 Apr, 2008

1 commit

  • There is a race condition when unloading bridge and netfilter.

    The problem happens if __fake_rtable is in use by a skb
    coming in, while someone starts to unload bridge.ko.
    br_netfilter_fini() is called at the beginning of unload
    in br_deinit() while skbs still are being forwarded and
    transferred to local ip stack. Thus there is a possibility
    of the __fake_rtable pointer not being removed in a skb that
    goes up to ip stack. This results in a kernel panic, as
    ip_rcv() calls the input-function of __fake_rtable, which
    is NULL.

    Moving the call of br_netfilter_fini() to the end of
    br_deinit() solves the problem.

    Signed-off-by: Bodo Stroesser
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Bodo Stroesser
     

29 Nov, 2007

1 commit


16 Oct, 2007

1 commit


26 Apr, 2007

2 commits


01 Jul, 2006

1 commit


18 Jun, 2006

2 commits

  • Add basic netlink support to the Ethernet bridge. Including:
    * dump interfaces in bridges
    * monitor link status changes
    * change state of bridge port

    For some demo programs see:
    http://developer.osdl.org/shemminger/prototypes/brnl.tar.gz

    These are to allow building a daemon that does alternative
    implementations of Spanning Tree Protocol.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Return address in use, if some other kernel code has the SAP.
    Propogate out error codes from netfilter registration and unwind.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

24 May, 2006

1 commit

  • Bridge will OOPS on removal if other application has the SAP open.
    The bridge SAP might be shared with other usages, so need
    to do reference counting on module removal rather than explicit
    close/delete.

    Since packet might arrive after or during removal, need to clear
    the receive function handle, so LLC only hands it to user (if any).

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

21 Mar, 2006

1 commit

  • Use LLC for the receive path of Spanning Tree Protocol packets.
    This allows link local multicast packets to be received by
    other protocols (if they care), and uses the existing LLC
    code to get STP packets back into bridge code.

    The bridge multicast address is also checked, so bridges using
    other link local multicast addresses are ignored. This allows
    for use of different multicast addresses to define separate STP
    domains.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

04 Jan, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds