tipc: use limited socket backlog
authorZhu Yi <yi.zhu@intel.com>
Thu, 4 Mar 2010 18:01:45 +0000 (18:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Mar 2010 21:34:02 +0000 (13:34 -0800)
Make tipc adapt to the limited socket backlog change.

Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c

index 1ea64f09cc455108de6f78ae00cce0d095b5baf3..22bfbc33a8aced869acc13ab60fa3886733c3cde 100644 (file)
@@ -1322,8 +1322,10 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf)
        if (!sock_owned_by_user(sk)) {
                res = filter_rcv(sk, buf);
        } else {
-               sk_add_backlog(sk, buf);
-               res = TIPC_OK;
+               if (sk_add_backlog_limited(sk, buf))
+                       res = TIPC_ERR_OVERLOAD;
+               else
+                       res = TIPC_OK;
        }
        bh_unlock_sock(sk);