1. 30 4月, 2015 2 次提交
    • N
      bridge/nl: remove wrong use of NLM_F_MULTI · 46c264da
      Nicolas Dichtel 提交于
      NLM_F_MULTI must be used only when a NLMSG_DONE message is sent. In fact,
      it is sent only at the end of a dump.
      
      Libraries like libnl will wait forever for NLMSG_DONE.
      
      Fixes: e5a55a89 ("net: create generic bridge ops")
      Fixes: 815cccbf ("ixgbe: add setlink, getlink support to ixgbe and ixgbevf")
      CC: John Fastabend <john.r.fastabend@intel.com>
      CC: Sathya Perla <sathya.perla@emulex.com>
      CC: Subbu Seetharaman <subbu.seetharaman@emulex.com>
      CC: Ajit Khaparde <ajit.khaparde@emulex.com>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: intel-wired-lan@lists.osuosl.org
      CC: Jiri Pirko <jiri@resnulli.us>
      CC: Scott Feldman <sfeldma@gmail.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      CC: bridge@lists.linux-foundation.org
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46c264da
    • N
      bridge/mdb: remove wrong use of NLM_F_MULTI · 82199679
      Nicolas Dichtel 提交于
      NLM_F_MULTI must be used only when a NLMSG_DONE message is sent. In fact,
      it is sent only at the end of a dump.
      
      Libraries like libnl will wait forever for NLMSG_DONE.
      
      Fixes: 37a393bc ("bridge: notify mdb changes via netlink")
      CC: Cong Wang <amwang@redhat.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      CC: bridge@lists.linux-foundation.org
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      82199679
  2. 13 4月, 2015 7 次提交
  3. 09 4月, 2015 1 次提交
  4. 08 4月, 2015 5 次提交
    • F
      netfilter: bridge: make BRNF_PKT_TYPE flag a bool · a1e67951
      Florian Westphal 提交于
      nf_bridge_info->mask is used for several things, for example to
      remember if skb->pkt_type was set to OTHER_HOST.
      
      For a bridge, OTHER_HOST is expected case. For ip forward its a non-starter
      though -- routing expects PACKET_HOST.
      
      Bridge netfilter thus changes OTHER_HOST to PACKET_HOST before hook
      invocation and then un-does it after hook traversal.
      
      This information is irrelevant outside of br_netfilter.
      
      After this change, ->mask now only contains flags that need to be
      known outside of br_netfilter in fast-path.
      
      Future patch changes mask into a 2bit state field in sk_buff, so that
      we can remove skb->nf_bridge pointer for good and consider all remaining
      places that access nf_bridge info content a not-so fastpath.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      a1e67951
    • F
      netfilter: bridge: start splitting mask into public/private chunks · 3eaf4025
      Florian Westphal 提交于
      ->mask is a bit info field that mixes various use cases.
      
      In particular, we have flags that are mutually exlusive, and flags that
      are only used within br_netfilter while others need to be exposed to
      other parts of the kernel.
      
      Remove BRNF_8021Q/PPPoE flags.  They're mutually exclusive and only
      needed within br_netfilter context.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      3eaf4025
    • F
      netfilter: bridge: add and use nf_bridge_info_get helper · 38330783
      Florian Westphal 提交于
      Don't access skb->nf_bridge directly, this pointer will be removed soon.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      38330783
    • F
      netfilter: bridge: don't use nf_bridge_info data to store mac header · e70deecb
      Florian Westphal 提交于
      br_netfilter maintains an extra state, nf_bridge_info, which is attached
      to skb via skb->nf_bridge pointer.
      
      Amongst other things we use skb->nf_bridge->data to store the original
      mac header for every processed skb.
      
      This is required for ip refragmentation when using conntrack
      on top of bridge, because ip_fragment doesn't copy it from original skb.
      
      However there is no need anymore to do this unconditionally.
      
      Move this to the one place where its needed -- when br_netfilter calls
      ip_fragment().
      
      Also switch to percpu storage for this so we can handle fragmenting
      without accessing nf_bridge meta data.
      
      Only user left is neigh resolution when DNAT is detected, to hold
      the original source mac address (neigh resolution builds new mac header
      using bridge mac), so rename ->data and reduce its size to whats needed.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      e70deecb
    • D
      netfilter: Pass socket pointer down through okfn(). · 7026b1dd
      David Miller 提交于
      On the output paths in particular, we have to sometimes deal with two
      socket contexts.  First, and usually skb->sk, is the local socket that
      generated the frame.
      
      And second, is potentially the socket used to control a tunneling
      socket, such as one the encapsulates using UDP.
      
      We do not want to disassociate skb->sk when encapsulating in order
      to fix this, because that would break socket memory accounting.
      
      The most extreme case where this can cause huge problems is an
      AF_PACKET socket transmitting over a vxlan device.  We hit code
      paths doing checks that assume they are dealing with an ipv4
      socket, but are actually operating upon the AF_PACKET one.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7026b1dd
  5. 05 4月, 2015 2 次提交
  6. 03 4月, 2015 1 次提交
  7. 02 4月, 2015 1 次提交
  8. 23 3月, 2015 1 次提交
  9. 19 3月, 2015 1 次提交
  10. 16 3月, 2015 2 次提交
  11. 15 3月, 2015 1 次提交
  12. 10 3月, 2015 4 次提交
  13. 09 3月, 2015 3 次提交
  14. 06 3月, 2015 1 次提交
    • J
      bridge: Extend Proxy ARP design to allow optional rules for Wi-Fi · 842a9ae0
      Jouni Malinen 提交于
      This extends the design in commit 95850116 ("bridge: Add support for
      IEEE 802.11 Proxy ARP") with optional set of rules that are needed to
      meet the IEEE 802.11 and Hotspot 2.0 requirements for ProxyARP. The
      previously added BR_PROXYARP behavior is left as-is and a new
      BR_PROXYARP_WIFI alternative is added so that this behavior can be
      configured from user space when required.
      
      In addition, this enables proxyarp functionality for unicast ARP
      requests for both BR_PROXYARP and BR_PROXYARP_WIFI since it is possible
      to use unicast as well as broadcast for these frames.
      
      The key differences in functionality:
      
      BR_PROXYARP:
      - uses the flag on the bridge port on which the request frame was
        received to determine whether to reply
      - block bridge port flooding completely on ports that enable proxy ARP
      
      BR_PROXYARP_WIFI:
      - uses the flag on the bridge port to which the target device of the
        request belongs
      - block bridge port flooding selectively based on whether the proxyarp
        functionality replied
      Signed-off-by: NJouni Malinen <jouni@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      842a9ae0
  15. 04 3月, 2015 2 次提交
  16. 03 3月, 2015 1 次提交
    • F
      netfilter: bridge: rework reject handling · 72500bc1
      Florian Westphal 提交于
      bridge reject handling is not straightforward, there are many subtle
      differences depending on configuration.
      
      skb->dev is either the bridge port (PRE_ROUTING) or the bridge
      itself (INPUT), so we need to use indev instead.
      
      Also, checksum validation will only work reliably if we trim skb
      according to the l3 header size.
      
      While at it, add csum validation for ipv6 and skip existing tests
      if skb was already checked e.g. by GRO.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      72500bc1
  17. 27 2月, 2015 1 次提交
    • R
      bridge: fix link notification skb size calculation to include vlan ranges · fed0a159
      Roopa Prabhu 提交于
      my previous patch skipped vlan range optimizations during skb size
      calculations for simplicity.
      
      This incremental patch considers vlan ranges during
      skb size calculations. This leads to a bit of code duplication
      in the fill and size calculation functions. But, I could not find a
      prettier way to do this. will take any suggestions.
      
      Previously, I had reused the existing br_get_link_af_size size calculation
      function to calculate skb size for notifications. Reusing it this time
      around creates some change in behaviour issues for the usual
      .get_link_af_size callback.
      
      This patch adds a new br_get_link_af_size_filtered() function to
      base the size calculation on the incoming filter flag and include
      vlan ranges.
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Reviewed-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fed0a159
  18. 23 2月, 2015 1 次提交
    • R
      bridge: add vlan info to bridge setlink and dellink notification messages · b7853d73
      Roopa Prabhu 提交于
      vlan add/deletes are not notified to userspace today. This patch adds
      vlan info to bridge newlink/dellink notifications generated from the
      bridge driver. Notifications use the RTEXT_FILTER_BRVLAN_COMPRESSED
      flag to compress vlans into ranges whereever applicable.
      
      The size calculations does not take ranges into account for
      simplicity.  This has the potential for allocating a larger skb than
      required.
      
      There is an existing inconsistency with bridge NEWLINK and DELLINK
      change notifications. Both generate NEWLINK notifications.  Since its
      always a NEWLINK notification, this patch includes all vlans the port
      belongs to in the notification. The NEWLINK and DELLINK request
      messages however only include the vlans to be added and deleted.
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7853d73
  19. 13 2月, 2015 1 次提交
  20. 10 2月, 2015 1 次提交
    • T
      bridge: Fix inability to add non-vlan fdb entry · 25d3b493
      Toshiaki Makita 提交于
      Bridge's default_pvid adds a vid by default, by which we cannot add a
      non-vlan fdb entry by default, because br_fdb_add() adds fdb entries for
      all vlans instead of a non-vlan one when any vlan is configured.
      
       # ip link add br0 type bridge
       # ip link set eth0 master br0
       # bridge fdb add 12:34:56:78:90:ab dev eth0 master temp
       # bridge fdb show brport eth0 | grep 12:34:56:78:90:ab
       12:34:56:78:90:ab dev eth0 vlan 1 static
      
      We expect a non-vlan fdb entry as well as vlan 1:
       12:34:56:78:90:ab dev eth0 static
      
      To fix this, we need to insert a non-vlan fdb entry if vlan is not
      specified, even when any vlan is configured.
      
      Fixes: 5be5a2df ("bridge: Add filtering support for default_pvid")
      Signed-off-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25d3b493
  21. 08 2月, 2015 1 次提交
    • R
      bridge: add missing bridge port check for offloads · 1fd0bddb
      Roopa Prabhu 提交于
      This patch fixes a missing bridge port check caught by smatch.
      
      setlink/dellink of attributes like vlans can come for a bridge device
      and there is no need to offload those today. So, this patch adds a bridge
      port check. (In these cases however, the BRIDGE_SELF flags will always be set
      and we may not hit a problem with the current code).
      
      smatch complaint:
      
      The patch 68e331c7: "bridge: offload bridge port attributes to
      switch asic if feature flag set" from Jan 29, 2015, leads to the
      following Smatch complaint:
      
      net/bridge/br_netlink.c:552 br_setlink()
      	 error: we previously assumed 'p' could be null (see line 518)
      
      net/bridge/br_netlink.c
         517
         518		if (p && protinfo) {
                          ^
      Check for NULL.
      Reported-By: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1fd0bddb