1. 24 Jun, 2008 7 commits
  2. 20 Jun, 2008 1 commit
  3. 19 Jun, 2008 13 commits
  4. 18 Jun, 2008 19 commits
    • Johannes Berg's avatar
      mac80211: detect driver tx bugs · ef3a62d2
      Johannes Berg authored
      When a driver rejects a frame in it's ->tx() callback, it must also
      stop queues, otherwise mac80211 can go into a loop here. Detect this
      situation and abort the loop after five retries, warning about the
      driver bug.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef3a62d2
    • Patrick McHardy's avatar
      netlink: genl: fix circular locking · 6d1a3fb5
      Patrick McHardy authored
      genetlink has a circular locking dependency when dumping the registered
      families:
      
      - dump start:
      genl_rcv()            : take genl_mutex
      genl_rcv_msg()        : call netlink_dump_start() while holding genl_mutex
      netlink_dump_start(),
      netlink_dump()        : take nlk->cb_mutex
      ctrl_dumpfamily()     : try to detect this case and not take genl_mutex a
                              second time
      
      - dump continuance:
      netlink_rcv()         : call netlink_dump
      netlink_dump          : take nlk->cb_mutex
      ctrl_dumpfamily()     : take genl_mutex
      
      Register genl_lock as callback mutex with netlink to fix this. This slightly
      widens an already existing module unload race, the genl ops used during the
      dump might go away when the module is unloaded. Thomas Graf is working on a
      seperate fix for this.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d1a3fb5
    • Wang Chen's avatar
      netdevice: Fix promiscuity and allmulti overflow · dad9b335
      Wang Chen authored
      Max of promiscuity and allmulti plus positive @inc can cause overflow.
      Fox example: when allmulti=0xFFFFFFFF, any caller give dev_set_allmulti() a
      positive @inc will cause allmulti be off.
      This is not what we want, though it's rare case.
      The fix is that only negative @inc will cause allmulti or promiscuity be off
      and when any caller makes the counters touch the roof, we return error.
      
      Change of v2:
      Change void function dev_set_promiscuity/allmulti to return int.
      So callers can get the overflow error.
      Caller's fix will be done later.
      
      Change of v3:
      1. Since we return error to caller, we don't need to print KERN_ERROR,
      KERN_WARNING is enough.
      2. In dev_set_promiscuity(), if __dev_set_promiscuity() failed, we
      return at once.
      Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
      Acked-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dad9b335
    • David S. Miller's avatar
      Revert "mac80211: Use skb_header_cloned() on TX path." · 3a5be7d4
      David S. Miller authored
      This reverts commit 608961a5.
      
      The problem is that the mac80211 stack not only needs to be able to
      muck with the link-level headers, it also might need to mangle all of
      the packet data if doing sw wireless encryption.
      
      This fixes kernel bugzilla #10903.  Thanks to Didier Raboud (for the
      bugzilla report), Andrew Prince (for bisecting), Johannes Berg (for
      bringing this bisection analysis to my attention), and Ilpo (for
      trying to analyze this purely from the TCP side).
      
      In 2.6.27 we can take another stab at this, by using something like
      skb_cow_data() when the TX path of mac80211 ends up with a non-NULL
      tx->key.  The ESP protocol code in the IPSEC stack can be used as a
      model for implementation.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a5be7d4
    • Rami Rosen's avatar
      ipv6: minor cleanup in net/ipv6/tcp_ipv6.c [RESEND ]. · dd574dbf
      Rami Rosen authored
      In net/ipv6/tcp_ipv6.c:
      
        - Remove unneeded tcp_v6_send_check() declaration.
      Signed-off-by: default avatarRami Rosen <ramirose@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd574dbf
    • David S. Miller's avatar
      net: Add sk_set_socket() helper. · 972692e0
      David S. Miller authored
      In order to more easily grep for all things that set
      sk->sk_socket, add sk_set_socket() helper inline function.
      
      Suggested (although only half-seriously) by Evgeniy Polyakov.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      972692e0
    • Rainer Weikusat's avatar
      af_unix: fix 'poll for write'/ connected DGRAM sockets · 3c73419c
      Rainer Weikusat authored
      The unix_dgram_sendmsg routine implements a (somewhat crude)
      form of receiver-imposed flow control by comparing the length of the
      receive queue of the 'peer socket' with the max_ack_backlog value
      stored in the corresponding sock structure, either blocking
      the thread which caused the send-routine to be called or returning
      EAGAIN. This routine is used by both SOCK_DGRAM and SOCK_SEQPACKET
      sockets. The poll-implementation for these socket types is
      datagram_poll from core/datagram.c. A socket is deemed to be writeable
      by this routine when the memory presently consumed by datagrams
      owned by it is less than the configured socket send buffer size. This
      is always wrong for connected PF_UNIX non-stream sockets when the
      abovementioned receive queue is currently considered to be full.
      'poll' will then return, indicating that the socket is writeable, but
      a subsequent write result in EAGAIN, effectively causing an
      (usual) application to 'poll for writeability by repeated send request
      with O_NONBLOCK set' until it has consumed its time quantum.
      
      The change below uses a suitably modified variant of the datagram_poll
      routines for both type of PF_UNIX sockets, which tests if the
      recv-queue of the peer a socket is connected to is presently
      considered to be 'full' as part of the 'is this socket
      writeable'-checking code. The socket being polled is additionally
      put onto the peer_wait wait queue associated with its peer, because the
      unix_dgram_sendmsg routine does a wake up on this queue after a
      datagram was received and the 'other wakeup call' is done implicitly
      as part of skb destruction, meaning, a process blocked in poll
      because of a full peer receive queue could otherwise sleep forever
      if no datagram owned by its socket was already sitting on this queue.
      Among this change is a small (inline) helper routine named
      'unix_recvq_full', which consolidates the actual testing code (in three
      different places) into a single location.
      Signed-off-by: default avatarRainer Weikusat <rweikusat@mssgmbh.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c73419c
    • David S. Miller's avatar
    • David S. Miller's avatar
    • David S. Miller's avatar
      ax25: Fix std timer socket destroy handling. · 30902dc3
      David S. Miller authored
      Tihomir Heidelberg - 9a4gl, reports:
      
      --------------------
      I would like to direct you attention to one problem existing in ax.25
      kernel since 2.4. If listening socket is closed and its SKB queue is
      released but those sockets get weird. Those "unAccepted()" sockets
      should be destroyed in ax25_std_heartbeat_expiry, but it will not
      happen. And there is also a note about that in ax25_std_timer.c:
      /* Magic here: If we listen() and a new link dies before it
      is accepted() it isn't 'dead' so doesn't get removed. */
      
      This issue cause ax25d to stop accepting new connections and I had to
      restarted ax25d approximately each day and my services were unavailable.
      Also netstat -n -l shows invalid source and device for those listening
      sockets. It is strange why ax25d's listening socket get weird because of
      this issue, but definitely when I solved this bug I do not have problems
      with ax25d anymore and my ax25d can run for months without problems.
      --------------------
      
      Actually as far as I can see, this problem is even in releases
      as far back as 2.2.x as well.
      
      It seems senseless to special case this test on TCP_LISTEN state.
      Anything still stuck in state 0 has no external references and
      we can just simply kill it off directly.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      30902dc3
    • Wang Chen's avatar
      netdevice: change net_device->promiscuity/allmulti to unsigned int · 9d45abe1
      Wang Chen authored
      The comments of dev_set_allmulti/promiscuity() is that "While the count in
      the device remains above zero...". So negative count is useless.
      Fix the type of the counter from "int" to "unsigned int".
      Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d45abe1
    • Ang Way Chuang's avatar
      tun: Proper handling of IPv6 header in tun driver when TUN_NO_PI is set · f09f7ee2
      Ang Way Chuang authored
      By default, tun.c running in TUN_TUN_DEV mode will set the protocol of
      packet to IPv4 if TUN_NO_PI is set. My program failed to work when I
      assumed that the driver will check the first nibble of packet,
      determine IP version and set the appropriate protocol.
      Signed-off-by: default avatarAng Way Chuang <wcang@nav6.org>
      Acked-by: default avatarMax Krasnyansky <maxk@qualcomm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f09f7ee2
    • Eric Dumazet's avatar
      udp: sk_drops handling · cb61cb9b
      Eric Dumazet authored
      In commits 33c732c3 ([IPV4]: Add raw
      drops counter) and a92aa318 ([IPV6]:
      Add raw drops counter), Wang Chen added raw drops counter for
      /proc/net/raw & /proc/net/raw6
      
      This patch adds this capability to UDP sockets too (/proc/net/udp &
      /proc/net/udp6).
      
      This means that 'RcvbufErrors' errors found in /proc/net/snmp can be also
      be examined for each udp socket.
      
      # grep Udp: /proc/net/snmp
      Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors
      Udp: 23971006 75 899420 16390693 146348 0
      
      # cat /proc/net/udp
       sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt  ---
      uid  timeout inode ref pointer drops
       75: 00000000:02CB 00000000:0000 07 00000000:00000000 00:00000000 00000000  ---
        0        0 2358 2 ffff81082a538c80 0
      111: 00000000:006F 00000000:0000 07 00000000:00000000 00:00000000 00000000  ---
        0        0 2286 2 ffff81042dd35c80 146348
      
      In this example, only port 111 (0x006F) was flooded by messages that
      user program could not read fast enough. 146348 messages were lost.
      Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb61cb9b
    • Jeff Kirsher's avatar
      MAINTAINERS · ae7b6487
      Jeff Kirsher authored
      Add PJ Waskiewicz to the list of maintainers for Intel 10/100/1000/10GbE
      adapters.
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarPJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      ae7b6487
    • Jay Vosburgh's avatar
      bonding: Allow setting max_bonds to zero · b8a9787e
      Jay Vosburgh authored
      	Permit bonding to function rationally if max_bonds is set to
      zero.  This will load the module, but create no master devices (which can
      be created via sysfs).
      
      	Requires some change to bond_create_sysfs; currently, the
      netdev sysfs directory is determined from the first bonding device created,
      but this is no longer possible.  Instead, an interface from net/core is
      created to create and destroy files in net_class.
      
      	Based on a patch submitted by Phil Oester <kernel@linuxaces.com>.
      Modified by Jay Vosburgh to fix the sysfs issue mentioned above and to
      update the documentation.
      Signed-off-by: default avatarPhil Oester <kernel@linuxace.com>
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b8a9787e
    • Jay Vosburgh's avatar
      bonding: Rework / fix multiple gratuitous ARP support · b59f9f74
      Jay Vosburgh authored
      	Support for sending multiple gratuitous ARPs during failovers
      was added by commit:
      
      commit 7893b249
      Author: Moni Shoua <monis@voltaire.com>
      Date:   Sat May 17 21:10:12 2008 -0700
      
          bonding: Send more than one gratuitous ARP when slave takes over
      
      	This change modifies that support to remove duplicated code,
      add support for ARP monitor (the original only supported miimon), clear
      the grat ARP counter in bond_close (lest a later "ifconfig up" immediately
      start spewing ARPs), and add documentation for the module parameter.
      
      	Also updated driver version to 3.3.0.
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      b59f9f74
    • Or Gerlitz's avatar
      bonding: deliver netdev event for fail-over under the active-backup mode · 01f3109d
      Or Gerlitz authored
      under active-backup mode and when there's actual new_active slave,
      have bond_change_active_slave() call the networking core to deliver
      NETDEV_BONDING_FAILOVER event such that the fail-over can be notable
      by code outside of the bonding driver such as the RDMA stack and
      monitoring tools.
      
      As the correct context of locking appropriate for notifier calls is RTNL
      and nothing else, bond->curr_slave_lock and bond->lock are unlocked and
      later locked again. This is ensured by the rest of the code to be safe
      under backup-mode AND when new_active is not NULL.
      
      Jay Vosburgh modified the original patch for formatting and fixed a
      compiler error.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      01f3109d
    • Or Gerlitz's avatar
      bonding: bond_change_active_slave() cleanup under active-backup · 709f8a45
      Or Gerlitz authored
      simplified the code of bond_change_active_slave() such that under
      active-backup mode there's one "if (new_active)" test and the rest
      of the code only does extra checks on top of it. This removed an
      unneeded "if (bond->send_grat_arp > 0)" check and avoid calling
      bond_send_gratuitous_arp when there's no active slave.
      
      Jay Vosburgh made minor coding style changes to the orignal patch.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      709f8a45
    • Or Gerlitz's avatar
      net/core: add NETDEV_BONDING_FAILOVER event · c1da4ac7
      Or Gerlitz authored
      Add NETDEV_BONDING_FAILOVER event to be used in a successive patch
      by bonding to announce fail-over for the active-backup mode through the
      netdev events notifier chain mechanism. Such an event can be of use for the
      RDMA CM (communication manager) to let native RDMA ULPs (eg NFS-RDMA, iSER)
      always be aligned with the IP stack, in the sense that they use the same
      ports/links as the stack does. More usages can be done to allow monitoring
      tools based on netlink events being aware to bonding fail-over.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@voltaire.com>
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      c1da4ac7