1. 07 10月, 2011 1 次提交
    • S
      bridge: allow forwarding some link local frames · 515853cc
      stephen hemminger 提交于
      This is based on an earlier patch by Nick Carter with comments
      by David Lamparter but with some refinements. Thanks for their patience
      this is a confusing area with overlap of standards, user requirements,
      and compatibility with earlier releases.
      
      It adds a new sysfs attribute
         /sys/class/net/brX/bridge/group_fwd_mask
      that controls forwarding of frames with address of: 01-80-C2-00-00-0X
      The default setting has no forwarding to retain compatibility.
      
      One change from earlier releases is that forwarding of group
      addresses is not dependent on STP being enabled or disabled. This
      choice was made based on interpretation of tie 802.1 standards.
      I expect complaints will arise because of this, but better to follow
      the standard than continue acting incorrectly by default.
      
      The filtering mask is writeable, but only values that don't forward
      known control frames are allowed. It intentionally blocks attempts
      to filter control protocols. For example: writing a 8 allows
      forwarding 802.1X PAE addresses which is the most common request.
      Reported-by: NDavid Lamparter <equinox@diac24.net>
      Original-patch-by: NNick Carter <ncarter100@gmail.com>
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Tested-by: NBenjamin Poirier <benjamin.poirier@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      515853cc
  2. 23 7月, 2011 1 次提交
    • S
      bridge: send proper message_age in config BPDU · 0c03150e
      stephen hemminger 提交于
      A bridge topology with three systems:
      
            +------+  +------+
            | A(2) |--| B(1) |
            +------+  +------+
                 \    /
                +------+
                | C(3) |
                +------+
      
      What is supposed to happen:
       * bridge with the lowest ID is elected root (for example: B)
       * C detects that A->C is higher cost path and puts in blocking state
      
      What happens. Bridge with lowest id (B) is elected correctly as
      root and things start out fine initially. But then config BPDU
      doesn't get transmitted from A -> C. Because of that
      the link from A-C is transistioned to the forwarding state.
      
      The root cause of this is that the configuration messages
      is generated with bogus message age, and dropped before
      sending.
      
      In the standardmessage_age is supposed to be:
        the time since the generation of the Configuration BPDU by
        the Root that instigated the generation of this Configuration BPDU.
      
      Reimplement this by recording the timestamp (age + jiffies) when
      recording config information. The old code incorrectly used the time
      elapsed on the ageing timer which was incorrect.
      
      See also:
        https://bugzilla.vyatta.com/show_bug.cgi?id=7164Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c03150e
  3. 29 4月, 2011 1 次提交
  4. 05 4月, 2011 4 次提交
  5. 28 3月, 2011 1 次提交
  6. 17 3月, 2011 1 次提交
  7. 12 2月, 2011 1 次提交
    • H
      bridge: Replace mp->mglist hlist with a bool · 8a870178
      Herbert Xu 提交于
      As it turns out we never need to walk through the list of multicast
      groups subscribed by the bridge interface itself (the only time we'd
      want to do that is when we shut down the bridge, in which case we
      simply walk through all multicast groups), we don't really need to
      keep an hlist for mp->mglist.
      
      This means that we can replace it with just a single bit to indicate
      whether the bridge interface is subscribed to a group.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a870178
  8. 25 1月, 2011 1 次提交
  9. 16 11月, 2010 3 次提交
  10. 02 7月, 2010 2 次提交
  11. 24 6月, 2010 1 次提交
  12. 16 6月, 2010 3 次提交
  13. 15 6月, 2010 1 次提交
    • P
      net: Make accesses to ->br_port safe for sparse RCU · 81bdf5bd
      Paul E. McKenney 提交于
      The new versions of the rcu_dereference() APIs requires that any pointers
      passed to one of these APIs be fully defined.  The ->br_port field
      in struct net_device points to a struct net_bridge_port, which is an
      incomplete type.  This commit therefore changes ->br_port to be a void*,
      and introduces a br_port() helper function to convert the type to struct
      net_bridge_port, and applies this new helper function where required.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      81bdf5bd
  14. 02 6月, 2010 1 次提交
  15. 16 5月, 2010 3 次提交
  16. 06 5月, 2010 1 次提交
    • W
      bridge: make bridge support netpoll · c06ee961
      WANG Cong 提交于
      Based on the previous patch, make bridge support netpoll by:
      
      1) implement the 2 methods to support netpoll for bridge;
      
      2) modify netpoll during forwarding packets via bridge;
      
      3) disable netpoll support of bridge when a netpoll-unabled device
         is added to bridge;
      
      4) enable netpoll support when all underlying devices support netpoll.
      
      Cc: David Miller <davem@davemloft.net>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: NWANG Cong <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c06ee961
  17. 23 4月, 2010 2 次提交
  18. 21 4月, 2010 1 次提交
  19. 17 3月, 2010 2 次提交
  20. 16 3月, 2010 1 次提交
    • M
      bridge: Fix br_forward crash in promiscuous mode · 7f7708f0
      Michael Braun 提交于
      From: Michael Braun <michael-dev@fami-braun.de>
      
      bridge: Fix br_forward crash in promiscuous mode
      
      It's a linux-next kernel from 2010-03-12 on an x86 system and it
      OOPs in the bridge module in br_pass_frame_up (called by
      br_handle_frame_finish) because brdev cannot be dereferenced (its set to
      a non-null value).
      
      Adding some BUG_ON statements revealed that
       BR_INPUT_SKB_CB(skb)->brdev == br-dev
      (as set in br_handle_frame_finish first)
      only holds until br_forward is called.
      The next call to br_pass_frame_up then fails.
      
      Digging deeper it seems that br_forward either frees the skb or passes
      it to NF_HOOK which will in turn take care of freeing the skb. The
      same is holds for br_pass_frame_ip. So it seems as if two independent
      skb allocations are required. As far as I can see, commit
      b33084be ("bridge: Avoid unnecessary
      clone on forward path") removed skb duplication and so likely causes
      this crash. This crash does not happen on 2.6.33.
      
      I've therefore modified br_forward the same way br_flood has been
      modified so that the skb is not freed if skb0 is going to be used
      and I can confirm that the attached patch resolves the issue for me.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7f7708f0
  21. 08 3月, 2010 1 次提交
  22. 02 3月, 2010 1 次提交
  23. 28 2月, 2010 6 次提交
    • H
      bridge: Add hash elasticity/max sysfs entries · b195167f
      Herbert Xu 提交于
      This patch allows the user to control the hash elasticity/max
      parameters.  The elasticity setting does not take effect until
      the next new multicast group is added.  At which point it is
      checked and if after rehashing it still can't be satisfied then
      snooping will be disabled.
      
      The max setting on the other hand takes effect immediately.  It
      must be a power of two and cannot be set to a value less than the
      current number of multicast group entries.  This is the only way
      to shrink the multicast hash.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b195167f
    • H
      bridge: Add multicast_snooping sysfs toggle · 561f1103
      Herbert Xu 提交于
      This patch allows the user to disable IGMP snooping completely
      through a sysfs toggle.  It also allows the user to reenable
      snooping when it has been automatically disabled due to hash
      collisions.  If the collisions have not been resolved however
      the system will refuse to reenable snooping.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      561f1103
    • H
      bridge: Add multicast_router sysfs entries · 0909e117
      Herbert Xu 提交于
      This patch allows the user to forcibly enable/disable ports as
      having multicast routers attached.  A port with a multicast router
      will receive all multicast traffic.
      
      The value 0 disables it completely.  The default is 1 which lets
      the system automatically detect the presence of routers (currently
      this is limited to picking up queries), and 2 means that the port
      will always receive all multicast traffic.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0909e117
    • H
      bridge: Add multicast forwarding functions · 5cb5e947
      Herbert Xu 提交于
      This patch adds code to perform selective multicast forwarding.
      
      We forward multicast traffic to a set of ports plus all multicast
      router ports.  In order to avoid duplications among these two
      sets of ports, we order all ports by the numeric value of their
      pointers.  The two lists are then walked in lock-step to eliminate
      duplicates.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5cb5e947
    • H
      bridge: Add core IGMP snooping support · eb1d1641
      Herbert Xu 提交于
      This patch adds the core functionality of IGMP snooping support
      without actually hooking it up.  So this patch should be a no-op
      as far as the bridge's external behaviour is concerned.
      
      All the new code and data is controlled by the Kconfig option
      BRIDGE_IGMP_SNOOPING.  A run-time toggle is also available.
      
      The multicast switching is done using an hash table that is
      lockless on the read-side through RCU.  On the write-side the
      new multicast_lock is used for all operations.  The hash table
      supports dynamic growth/rehashing.
      
      The hash table will be rehashed if any chain length exceeds a
      preset limit.  If rehashing does not reduce the maximum chain
      length then snooping will be disabled.
      
      These features may be added in future (in no particular order):
      
      * IGMPv3 source support
      * Non-querier router detection
      * IPv6
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb1d1641
    • H
      bridge: Avoid unnecessary clone on forward path · b33084be
      Herbert Xu 提交于
      When the packet is delivered to the local bridge device we may
      end up cloning it unnecessarily if no bridge port can receive
      the packet in br_flood.
      
      This patch avoids this by moving the skb_clone into br_flood.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b33084be