Commit 423abd9d authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents a77e4c96 56b5adfb
...@@ -684,7 +684,7 @@ fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb, ...@@ -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) { list_for_each_entry(fa, &f->fn_alias, fa_list) {
if (i < s_i) if (i < s_i)
continue; goto next;
if (fib_dump_info(skb, NETLINK_CB(cb->skb).pid, if (fib_dump_info(skb, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq,
...@@ -699,7 +699,7 @@ fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb, ...@@ -699,7 +699,7 @@ fn_hash_dump_bucket(struct sk_buff *skb, struct netlink_callback *cb,
cb->args[3] = i; cb->args[3] = i;
return -1; return -1;
} }
next:
i++; i++;
} }
} }
......
...@@ -1850,15 +1850,22 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1850,15 +1850,22 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCINQ: case SIOCINQ:
{ {
struct sk_buff *skb; struct sk_buff *skb;
if (sk->sk_state == TCP_LISTEN) { if (sk->sk_state == TCP_LISTEN) {
err = -EINVAL; err = -EINVAL;
break; break;
} }
spin_lock(&sk->sk_receive_queue.lock); spin_lock(&sk->sk_receive_queue.lock);
skb = skb_peek(&sk->sk_receive_queue); if (sk->sk_type == SOCK_STREAM ||
if (skb) sk->sk_type == SOCK_SEQPACKET) {
amount=skb->len; 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); spin_unlock(&sk->sk_receive_queue.lock);
err = put_user(amount, (int __user *)arg); err = put_user(amount, (int __user *)arg);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment