>A counter seems a best choice than a printk. Agreed.
In the SOCK_RAW code there's just something like that:
static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb)
{
/* Charge it to the socket. */
if (sock_queue_rcv_skb(sk,skb)<0)
{
ip_statistics.IpInDiscards++;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
kfree_skb(skb);
return -1;
}
ip_statistics.IpInDelivers++;
return 0;
}
If as you said af_packet is just backwards compatibity code, I think we
are just ok and for debugging we only need to increase rmem_default and
look at the number of discarded packets.
But I have to say that I tried to recompile tcpdump only changing the two
occourence of SOCK_PACKET to SOCK_RAW and tcpdump started working only on
`lo' and not `eth0'.
I am not going into this `packet/raw rcvbuf size' issue right now though.
I am just quite happy to know exactly the reason of the lost frames and
how to fast workaround the problem (or via rmem_default or with my
previous patches).
Andrea Arcangeli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/