1. 02 Jun, 2016 3 commits
    • Herbert Xu's avatar
      macvlan: Avoid unnecessary multicast cloning · 9c127a01
      Herbert Xu authored
      Currently we always queue a multicast packet for further processing,
      even if none of the macvlan devices are subscribed to the address.
      
      This patch optimises this by adding a global multicast filter for
      a macvlan_port.
      
      Note that this patch doesn't handle the broadcast addresses of the
      individual macvlan devices correctly, if they are not all identical
      to vlan->lowerdev.  However, this is already broken because there
      is no mechanism in place to update the individual multicast filters
      when you change the broadcast address.
      
      If someone cares enough they should fix this by collecting all
      broadcast addresses for a macvlan as we do for multicast and unicast.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c127a01
    • Herbert Xu's avatar
      macvlan: Fix potential use-after free for broadcasts · 260916df
      Herbert Xu authored
      When we postpone a broadcast packet we save the source port in
      the skb if it is local.  However, the source port can disappear
      before we get a chance to process the packet.
      
      This patch fixes this by holding a ref count on the netdev.
      
      It also delays the skb->cb modification until after we allocate
      the new skb as you should not modify shared skbs.
      
      Fixes: 412ca155 ("macvlan: Move broadcasts into a work queue")
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      260916df
    • Eric Dumazet's avatar
      udp: avoid csum_partial() for validated skb · 595d0b29
      Eric Dumazet authored
      In commit e6afc8ac ("udp: remove headers from UDP packets before
      queueing"), udp_csum_pull_header() helper was added but missed fact
      that CHECKSUM_UNNECESSARY packets were now converted to CHECKSUM_NONE
      and skb->csum_valid was set to 1 for them.
      
      Since csum_partial() is quite expensive, even for 8-byte area, it is
      worth adding a test.
      
      We also can use skb->data instead of udp_hdr() as we are pulling
      UDP headers, as it is sightly faster.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      595d0b29
  2. 01 Jun, 2016 5 commits
  3. 31 May, 2016 15 commits
  4. 30 May, 2016 17 commits