For a while I've been wanting a way for a program to find out if any of its socket buffers were overflowing due to too much incoming traffic. Finally, I decided to code it up and try it out. As it turns out, it was relatively simple to add, although it required the addition of two new entries in sockios.h. Basically, inside of sock_queue_rcv_skb() and sock_queue_err_skb() the receive counter gets incremented unconditionally, and then if there is no free space in the socket buffer then we also increment the counter for messages dropped due to out of memory. The stats are stored as part of a socket_stats struct, making it easy to add other counters in the future. To access and reset the counters, two ioctl commands were added to the socket ioctl. GIOCSOCKSTATS is used to get the stats, while SIOCZEROSOCKSTATS is used to reset them. I haven't bothered with trying to reset them both atomically as I don't think it's that critical. The patch was coded and tested for 2.4.18, but it is known to at least apply (with offsets) on 2.5.20. Feel free to bash on it a bit, once the issues are worked out I'll submit to the appropriate maintainer. Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com