diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-10 23:18:26 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-10 23:18:26 +0000 |
commit | c7c4310f7fc1485925d800628bf50b3aeab535ef (patch) | |
tree | b12aa4be0e8fb82aaaea97fb475e793e8a347c49 /net/packet | |
parent | 1ffd1d069ca4c5ffe16fea6175dab1b9bbb15820 (diff) |
Merge with Linux 2.4.0-test3-pre8. Linus has accepted most of what
I've sent him, so we're very close to full integration of the MIPS
port into his sources.
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 2955a04f6..3b2df4f55 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -5,7 +5,7 @@ * * PACKET - implements raw packet sockets. * - * Version: $Id: af_packet.c,v 1.34 2000/04/25 04:13:35 davem Exp $ + * Version: $Id: af_packet.c,v 1.36 2000/07/08 00:20:43 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -1053,7 +1053,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, int len, err = memcpy_toiovec(msg->msg_iov, skb->data, copied); if (err) goto out_free; - sk->stamp=skb->stamp; + + sock_recv_timestamp(msg, sk, skb); if (msg->msg_name) memcpy(msg->msg_name, skb->cb, msg->msg_namelen); @@ -1392,6 +1393,23 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg switch(cmd) { + case SIOCOUTQ: + { + int amount = atomic_read(&sk->wmem_alloc); + return put_user(amount, (int *)arg); + } + case SIOCINQ: + { + struct sk_buff *skb; + int amount = 0; + + spin_lock_bh(&sk->receive_queue.lock); + skb = skb_peek(&sk->receive_queue); + if (skb) + amount = skb->len; + spin_unlock_bh(&sk->receive_queue.lock); + return put_user(amount, (int *)arg); + } case FIOSETOWN: case SIOCSPGRP: err = get_user(pid, (int *) arg); |