1. 09 9月, 2015 2 次提交
  2. 29 8月, 2015 1 次提交
    • F
      netfilter: reduce sparse warnings · 851345c5
      Florian Westphal 提交于
      bridge/netfilter/ebtables.c:290:26: warning: incorrect type in assignment (different modifiers)
      -> remove __pure annotation.
      
      ipv6/netfilter/ip6t_SYNPROXY.c:240:27: warning: cast from restricted __be16
      -> switch ntohs to htons and vice versa.
      
      netfilter/core.c:391:30: warning: symbol 'nfq_ct_nat_hook' was not declared. Should it be static?
      -> delete it, got removed
      
      net/netfilter/nf_synproxy_core.c:221:48: warning: cast to restricted __be32
      -> Use __be32 instead of u32.
      
      Tested with objdiff that these changes do not affect generated code.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      851345c5
  3. 28 8月, 2015 2 次提交
    • N
      bridge: fdb: rearrange net_bridge_fdb_entry · b22fbf22
      Nikolay Aleksandrov 提交于
      While looking into fixing the local entries scalability issue I noticed
      that the structure is badly arranged because vlan_id would fall in a
      second cache line while keeping rcu which is used only when deleting
      in the first, so re-arrange the structure and push rcu to the end so we
      can get 16 bytes which can be used for other fields (by pushing rcu
      fully in the second 64 byte chunk). With this change all the core
      necessary information when doing fdb lookups will be available in a
      single cache line.
      
      pahole before (note vlan_id):
      struct net_bridge_fdb_entry {
      	struct hlist_node          hlist;                /*     0    16 */
      	struct net_bridge_port *   dst;                  /*    16     8 */
      	struct callback_head       rcu;                  /*    24    16 */
      	long unsigned int          updated;              /*    40     8 */
      	long unsigned int          used;                 /*    48     8 */
      	mac_addr                   addr;                 /*    56     6 */
      	unsigned char              is_local:1;           /*    62: 7  1 */
      	unsigned char              is_static:1;          /*    62: 6  1 */
      	unsigned char              added_by_user:1;      /*    62: 5  1 */
      	unsigned char              added_by_external_learn:1; /*    62: 4  1 */
      
      	/* XXX 4 bits hole, try to pack */
      	/* XXX 1 byte hole, try to pack */
      
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	__u16                      vlan_id;              /*    64     2 */
      
      	/* size: 72, cachelines: 2, members: 11 */
      	/* sum members: 65, holes: 1, sum holes: 1 */
      	/* bit holes: 1, sum bit holes: 4 bits */
      	/* padding: 6 */
      	/* last cacheline: 8 bytes */
      }
      
      pahole after (note vlan_id):
      struct net_bridge_fdb_entry {
      	struct hlist_node          hlist;                /*     0    16 */
      	struct net_bridge_port *   dst;                  /*    16     8 */
      	long unsigned int          updated;              /*    24     8 */
      	long unsigned int          used;                 /*    32     8 */
      	mac_addr                   addr;                 /*    40     6 */
      	__u16                      vlan_id;              /*    46     2 */
      	unsigned char              is_local:1;           /*    48: 7  1 */
      	unsigned char              is_static:1;          /*    48: 6  1 */
      	unsigned char              added_by_user:1;      /*    48: 5  1 */
      	unsigned char              added_by_external_learn:1; /*    48: 4  1 */
      
      	/* XXX 4 bits hole, try to pack */
      	/* XXX 7 bytes hole, try to pack */
      
      	struct callback_head       rcu;                  /*    56    16 */
      	/* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
      
      	/* size: 72, cachelines: 2, members: 11 */
      	/* sum members: 65, holes: 1, sum holes: 7 */
      	/* bit holes: 1, sum bit holes: 4 bits */
      	/* last cacheline: 8 bytes */
      }
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b22fbf22
    • T
      bridge: Add netlink support for vlan_protocol attribute · d2d427b3
      Toshiaki Makita 提交于
      This enables bridge vlan_protocol to be configured through netlink.
      
      When CONFIG_BRIDGE_VLAN_FILTERING is disabled, kernel behaves the
      same way as this feature is not implemented.
      Signed-off-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2d427b3
  4. 21 8月, 2015 1 次提交
  5. 19 8月, 2015 1 次提交
  6. 14 8月, 2015 1 次提交
  7. 12 8月, 2015 1 次提交
  8. 11 8月, 2015 1 次提交
  9. 10 8月, 2015 1 次提交
  10. 07 8月, 2015 2 次提交
  11. 04 8月, 2015 3 次提交
  12. 30 7月, 2015 5 次提交
    • B
      netfilter: bridge: do not initialize statics to 0 or NULL · f4b3eee7
      Bernhard Thaler 提交于
      Fix checkpatch.pl "ERROR: do not initialise statics to 0 or NULL" for
      all statics explicitly initialized to 0.
      Signed-off-by: NBernhard Thaler <bernhard.thaler@wvnet.at>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      f4b3eee7
    • F
      netfilter: bridge: reduce nf_bridge_info to 32 bytes again · 72b1e5e4
      Florian Westphal 提交于
      We can use union for most of the temporary cruft (original ipv4/ipv6
      address, source mac, physoutdev) since they're used during different
      stages of br netfilter traversal.
      
      Also get rid of the last two ->mask users.
      
      Shrinks struct from 48 to 32 on 64bit arch.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      72b1e5e4
    • N
      bridge: mdb: fix delmdb state in the notification · 7ae90a4f
      Nikolay Aleksandrov 提交于
      Since mdb states were introduced when deleting an entry the state was
      left as it was set in the delete request from the user which leads to
      the following output when doing a monitor (for example):
      $ bridge mdb add dev br0 port eth3 grp 239.0.0.1 permanent
      (monitor) dev br0 port eth3 grp 239.0.0.1 permanent
      $ bridge mdb del dev br0 port eth3 grp 239.0.0.1 permanent
      (monitor) dev br0 port eth3 grp 239.0.0.1 temp
      ^^^
      Note the "temp" state in the delete notification which is wrong since
      the entry was permanent, the state in a delete is always reported as
      "temp" regardless of the real state of the entry.
      
      After this patch:
      $ bridge mdb add dev br0 port eth3 grp 239.0.0.1 permanent
      (monitor) dev br0 port eth3 grp 239.0.0.1 permanent
      $ bridge mdb del dev br0 port eth3 grp 239.0.0.1 permanent
      (monitor) dev br0 port eth3 grp 239.0.0.1 permanent
      
      There's one important note to make here that the state is actually not
      matched when doing a delete, so one can delete a permanent entry by
      stating "temp" in the end of the command, I've chosen this fix in order
      not to break user-space tools which rely on this (incorrect) behaviour.
      
      So to give an example after this patch and using the wrong state:
      $ bridge mdb add dev br0 port eth3 grp 239.0.0.1 permanent
      (monitor) dev br0 port eth3 grp 239.0.0.1 permanent
      $ bridge mdb del dev br0 port eth3 grp 239.0.0.1 temp
      (monitor) dev br0 port eth3 grp 239.0.0.1 permanent
      
      Note the state of the entry that got deleted is correct in the
      notification.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Fixes: ccb1c31a ("bridge: add flags to distinguish permanent mdb entires")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ae90a4f
    • S
      bridge: mcast: give fast leave precedence over multicast router and querier · 544586f7
      Satish Ashok 提交于
      When fast leave is configured on a bridge port and an IGMP leave is
      received for a group, the group is not deleted immediately if there is
      a router detected or if multicast querier is configured.
      Ideally the group should be deleted immediately when fast leave is
      configured.
      Signed-off-by: NSatish Ashok <sashok@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      544586f7
    • T
      bridge: Fix network header pointer for vlan tagged packets · df356d5e
      Toshiaki Makita 提交于
      There are several devices that can receive vlan tagged packets with
      CHECKSUM_PARTIAL like tap, possibly veth and xennet.
      When (multiple) vlan tagged packets with CHECKSUM_PARTIAL are forwarded
      by bridge to a device with the IP_CSUM feature, they end up with checksum
      error because before entering bridge, the network header is set to
      ETH_HLEN (not including vlan header length) in __netif_receive_skb_core(),
      get_rps_cpu(), or drivers' rx functions, and nobody fixes the pointer later.
      
      Since the network header is exepected to be ETH_HLEN in flow-dissection
      and hash-calculation in RPS in rx path, and since the header pointer fix
      is needed only in tx path, set the appropriate network header on forwarding
      packets.
      Signed-off-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df356d5e
  13. 29 7月, 2015 1 次提交
  14. 27 7月, 2015 2 次提交
  15. 25 7月, 2015 1 次提交
  16. 21 7月, 2015 3 次提交
  17. 16 7月, 2015 2 次提交
  18. 14 7月, 2015 1 次提交
  19. 11 7月, 2015 1 次提交
  20. 10 7月, 2015 2 次提交
  21. 09 7月, 2015 2 次提交
  22. 08 7月, 2015 1 次提交
    • J
      netfilter: bridge: Use __in6_dev_get rather than in6_dev_get in br_validate_ipv6 · 86e89718
      Julien Grall 提交于
      The commit efb6de9b "netfilter: bridge:
      forward IPv6 fragmented packets" introduced a new function
      br_validate_ipv6 which take a reference on the inet6 device. Although,
      the reference is not released at the end.
      
      This will result to the impossibility to destroy any netdevice using
      ipv6 and bridge.
      
      It's possible to directly retrieve the inet6 device without taking a
      reference as all netfilter hooks are protected by rcu_read_lock via
      nf_hook_slow.
      
      Spotted while trying to destroy a Xen guest on the upstream Linux:
      "unregister_netdevice: waiting for vif1.0 to become free. Usage count = 1"
      Signed-off-by: NJulien Grall <julien.grall@citrix.com>
      Cc: Bernhard Thaler <bernhard.thaler@wvnet.at>
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Cc: fw@strlen.de
      Cc: ian.campbell@citrix.com
      Cc: wei.liu2@citrix.com
      Cc: Bob Liu <bob.liu@oracle.com>
      Acked-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      86e89718
  23. 03 7月, 2015 1 次提交
  24. 02 7月, 2015 2 次提交