1. 13 6月, 2012 3 次提交
    • E
      bonding: Fix corrupted queue_mapping · 5ee31c68
      Eric Dumazet 提交于
      In the transmit path of the bonding driver, skb->cb is used to
      stash the skb->queue_mapping so that the bonding device can set its
      own queue mapping.  This value becomes corrupted since the skb->cb is
      also used in __dev_xmit_skb.
      
      When transmitting through bonding driver, bond_select_queue is
      called from dev_queue_xmit.  In bond_select_queue the original
      skb->queue_mapping is copied into skb->cb (via bond_queue_mapping)
      and skb->queue_mapping is overwritten with the bond driver queue.
      
      Subsequently in dev_queue_xmit, __dev_xmit_skb is called which writes
      the packet length into skb->cb, thereby overwriting the stashed
      queue mappping.  In bond_dev_queue_xmit (called from hard_start_xmit),
      the queue mapping for the skb is set to the stashed value which is now
      the skb length and hence is an invalid queue for the slave device.
      
      If we want to save skb->queue_mapping into skb->cb[], best place is to
      add a field in struct qdisc_skb_cb, to make sure it wont conflict with
      other layers (eg : Qdiscc, Infiniband...)
      
      This patchs also makes sure (struct qdisc_skb_cb)->data is aligned on 8
      bytes :
      
      netem qdisc for example assumes it can store an u64 in it, without
      misalignment penalty.
      
      Note : we only have 20 bytes left in (struct qdisc_skb_cb)->data[].
      The largest user is CHOKe and it fills it.
      
      Based on a previous patch from Tom Herbert.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NTom Herbert <therbert@google.com>
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Cc: Roland Dreier <roland@kernel.org>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ee31c68
    • W
      bonding:record primary when modify it via sysfs · 8a93664d
      Weiping Pan 提交于
      If we modify primary via sysfs and it is not a valid slave,
      we should record it for future use, and this behavior is the same with
      bond_check_params().
      Signed-off-by: NWeiping Pan <wpan@redhat.com>
      Acked-by: NNicolas de Pesloüan <nicolas.2p.debian@free.fr>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a93664d
    • D
      Merge branch 'master' of git://1984.lsi.us.es/net · 5aa04d3a
      David S. Miller 提交于
      5aa04d3a
  2. 12 6月, 2012 6 次提交
  3. 11 6月, 2012 4 次提交
  4. 10 6月, 2012 1 次提交
    • P
      net: Make linux/tcp.h C++ friendly (trivial) · 8876d6b5
      Paul Pluzhnikov 提交于
      I originally sent this patch to <trivial@kernel.org>, but Jiri Kosina did
      not feel that this is fully appropriate for the trivial tree.
      
      Using linux/tcp.h from C++ results in:
      
      cat t.cc
      #include <linux/tcp.h>
      int main() { }
      
      g++ -c t.cc
      
      In file included from t.cc:1:
      /usr/include/linux/tcp.h:72: error: '__u32 __fswab32(__u32)' cannot appear in a constant-expression
      /usr/include/linux/tcp.h:72: error: a function call cannot appear in a constant-expression
      ...
      
      Attached trivial patch fixes this problem.
      
      Tested:
      - the t.cc above compiles with g++ and
      - the following program generates the same output before/after
        the patch:
      
      #include <linux/tcp.h>
      #include <stdio.h>
      
      int main ()
      {
      #define P(a) printf("%s: %08x\n", #a, (int)a)
       P(TCP_FLAG_CWR);
       P(TCP_FLAG_ECE);
       P(TCP_FLAG_URG);
       P(TCP_FLAG_ACK);
       P(TCP_FLAG_PSH);
       P(TCP_FLAG_RST);
       P(TCP_FLAG_SYN);
       P(TCP_FLAG_FIN);
       P(TCP_RESERVED_BITS);
       P(TCP_DATA_OFFSET);
      #undef P
       return 0;
      }
      Signed-off-by: NPaul Pluzhnikov <ppluzhnikov@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8876d6b5
  5. 09 6月, 2012 15 次提交
  6. 08 6月, 2012 8 次提交
  7. 07 6月, 2012 3 次提交
    • P
      netfilter: nf_ct_h323: fix bug in rtcp natting · d109e9af
      Pablo Neira Ayuso 提交于
      The nat_rtp_rtcp hook takes two separate parameters port and rtp_port.
      
      port is expected to be the real h245 address (found inside the packet).
      rtp_port is the even number closest to port (RTP ports are even and
      RTCP ports are odd).
      
      However currently, both port and rtp_port are having same value (both are
      rounded to nearest even numbers).
      
      This works well in case of openlogicalchannel with media (RTP/even) port.
      
      But in case of openlogicalchannel for media control (RTCP/odd) port,
      h245 address in the packet is wrongly modified to have an even port.
      
      I am attaching a pcap demonstrating the problem, for any further analysis.
      
      This behavior was introduced around v2.6.19 while rewriting the helper.
      Signed-off-by: NJagdish Motwani <jagdish.motwani@elitecore.com>
      Signed-off-by: NSanket Shah <sanket.shah@elitecore.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      d109e9af
    • H
      netfilter: xt_HMARK: fix endianness and provide consistent hashing · d1992b16
      Hans Schillstrom 提交于
      This patch addresses two issues:
      
      a) Fix usage of u32 and __be32 that causes endianess warnings via sparse.
      b) Ensure consistent hashing in a cluster that is composed of big and
         little endian systems. Thus, we obtain the same hash mark in an
         heterogeneous cluster.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NHans Schillstrom <hans@schillstrom.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      d1992b16
    • D
      Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless · da2e8526
      David S. Miller 提交于
      John Linville says:
      ====================
      Amitkumar Karwar gives us a cfg80211 fix that changes some state
      tracking in order to avoid a WARNING.
      
      Arik Nemtsov provide a mac80211 fix for an RCU-related race.
      
      Avinash Patil shares a pair of mwifiex fixes, one which invalidates
      some stale configuration data before a channel change and another to
      restrict hidden SSID support to zero-length SSIDs only.
      
      Chun-Yeow Yeoh brings a mac80211 fix for a mesh problem triggered
      when combining multiple mesh networks into one.
      
      Felix Fietkau provides a mac80211 lockdep fix.
      
      Joe Perches fixes a couple of thinkos related to bitwise operations.
      
      Johannes Berg comes through with a flurry of fixes.  The iwlwifi ones
      address a problem Linus recently reported, and some of the fallout
      discovered while fixing it.  The mac80211 fix properly cleans-up
      remain-on-channel work on an interface that is stopped.  The others
      are clean-ups for regressions caused by stricter checking of possible
      virtual interfaces supported by wireless drivers.
      
      Meenakshi Venkataraman provides a mac80211 fix for an off-by-one error.
      
      Seth Forshee provides a fix to make the wireless adapters used in
      some Mac boxes work after being in S3 power saving state.
      
      Stanislaw Gruszka offers a copule of fixes, a fix for a mac80211
      scanning regression and an rt2x00 fix to avoid some lockdep spew.
      
      Last but not least, Vinicius Costa Gomes provides a bluetooth fix
      for a typo that "was preventing important features of Bluetooth
      from working".
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da2e8526