DORMANTno replies

[PATCH] Inconsistent behaviour at AF_PACKET

From: Unai Uribarri <hidden>
Date: 2007-08-01 19:00:18
Subsystem: networking [general], packet sockets, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Linus Torvalds

Hello folks,

Timestamps should be usually requested explicitly by setting the
SOL_SOCKET/SO_TIMESTAMP option to 1. But if you setup a reception ring
with the SOL_PACKET/PACKET_RX_RING option, timestamps are automatically
enabled at the next packet recepcion.

I think that is a bug so I have written a patch that corrects it.

Thanks.
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1322d62..a4f2da3 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -640,10 +640,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct
net_device *dev, struct packe
        h->tp_snaplen = snaplen;
        h->tp_mac = macoff;
        h->tp_net = netoff;
-       if (skb->tstamp.tv64 == 0) {
-               __net_timestamp(skb);
-               sock_enable_timestamp(sk);
-       }
        tv = ktime_to_timeval(skb->tstamp);
        h->tp_sec = tv.tv_sec;
        h->tp_usec = tv.tv_usec;


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help