public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Unai Uribarri <unai.uribarri@optenet.com>
To: netdev@vger.kernel.org
Subject: [PATCH] Inconsistent behaviour at AF_PACKET
Date: Wed, 01 Aug 2007 21:00:15 +0200	[thread overview]
Message-ID: <1185994815.18046.25.camel@localhost.localdomain> (raw)

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;




                 reply	other threads:[~2007-08-01 19:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1185994815.18046.25.camel@localhost.localdomain \
    --to=unai.uribarri@optenet.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox