summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-02-26 23:55:31 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-02-26 23:55:31 -0800
commit423abd9d79b147d4582d9f9624099de5f8dd2766 (patch)
treeba866a4e1334b6e80d237729df800ea8e528fc2f
parenta77e4c96f5a230d5442c9aebe63db1ae742cab4c (diff)
parent56b5adfb617ca66a649dceb9a054a059ff1cc387 (diff)
Merge bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
-rw-r--r--net/ipv4/fib_hash.c4
-rw-r--r--net/unix/af_unix.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 688e551cc5af..1bf3844dfa42 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -684,7 +684,7 @@ fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb,
list_for_each_entry(fa, &f->fn_alias, fa_list) {
if (i < s_i)
- continue;
+ goto next;
if (fib_dump_info(skb, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq,
@@ -699,7 +699,7 @@ fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb,
cb->args[3] = i;
return -1;
}
-
+ next:
i++;
}
}
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 062bcc2080a7..5658798cabc1 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1850,15 +1850,22 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCINQ:
{
struct sk_buff *skb;
+
if (sk->sk_state == TCP_LISTEN) {
err = -EINVAL;
break;
}
spin_lock(&sk->sk_receive_queue.lock);
- skb = skb_peek(&sk->sk_receive_queue);
- if (skb)
- amount=skb->len;
+ if (sk->sk_type == SOCK_STREAM ||
+ sk->sk_type == SOCK_SEQPACKET) {
+ skb_queue_walk(&sk->sk_receive_queue, skb)
+ amount += skb->len;
+ } else {
+ skb = skb_peek(&sk->sk_receive_queue);
+ if (skb)
+ amount=skb->len;
+ }
spin_unlock(&sk->sk_receive_queue.lock);
err = put_user(amount, (int __user *)arg);
break;