mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joan Raventos <jraventos@yahoo.com>
To: Patrick McHardy <kaber@trash.net>
Cc: linux-kernel@vger.kernel.org, Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: poll problem with PF_PACKET when using PACKET_RX_RING
Date: Sun, 15 Oct 2006 11:10:59 -0700 (PDT)	[thread overview]
Message-ID: <20061015181059.8920.qmail@web50601.mail.yahoo.com> (raw)

Hi Patrick,

Thx for your prompt reply! Plz see some comments inline.

>> 
>> Is this a bug in PF_PACKET? Should the socket queue be
>> emptied by packet_set_ring (called via setsockopt when
>> PACKET_RX_RING is used) so the above cannot happen?
>> Should the user-space app drain the socket queue with
>> recvfrom prior to (4) -quite unlikely in practice-?


> I guess the best way is not to bind the socket before having
> completed setup. We could still flush the queue to make life
> easier for userspace, not sure about that ..

Even w/o bind, packet_create is doing a dev_add_pack, which I think will make pkts arrive to that socket (ie. in netif_receive_skb one can see the loops over the rcu for both ptype_all and type-specific which seem match whenever !ptype->dev || ptype->dev==skb->dev).

Also the packet_mmap.txt doc does not mention bind, which probably is more a mechanism to closely specify a dev than to signal socket readiness.

Salu2,
J.





             reply	other threads:[~2006-10-15 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-15 18:10 Joan Raventos [this message]
2006-10-16  6:18 ` Patrick McHardy
  -- strict thread matches above, loose matches on Subject: below --
2006-10-16 19:39 Joan Raventos
2006-10-14 21:43 Joan Raventos
2006-10-15 14:00 ` Patrick McHardy
2006-10-16 10:56 ` Pádraig Brady

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=20061015181059.8920.qmail@web50601.mail.yahoo.com \
    --to=jraventos@yahoo.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®