All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: linux-kselftest@vger.kernel.org,
	Network Development <netdev@vger.kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Willem de Bruijn <willemb@google.com>,
	David Miller <davem@davemloft.net>,
	shuah@kernel.org
Subject: Re: [PATCH net-next 2/2] tools: psock_tpacket: verify that packet was received on lo before counting it
Date: Wed, 4 Jan 2017 09:44:24 -0500	[thread overview]
Message-ID: <20170104144424.GD9641@oracle.com> (raw)
In-Reply-To: <CAF=yD-+d-cgE1dxCcrfNZfgVk4_wjYMHHoQ=BN7bnJ-txbM-+Q@mail.gmail.com>

On (01/04/17 09:30), Willem de Bruijn wrote:
> 
> The common and simpler solution to this problem is to open the socket
> with protocol 0 to reject all packets, add the BPF filter and only then bind
> with sll_ifindex set to lo. That way no false positives can arrive.

Yes, I thought of that too (and I've seen that done in one commercial
implementation), but given that tpacket nicely returns the incoming
interface, I figured, why not use the test prog to use this (thus
verifying it, and also showing how to use it)

--Sowmini

  reply	other threads:[~2017-01-04 14:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 23:27 [PATCH net-next 0/2] tools: psock_tpacket bug fixes Sowmini Varadhan
2017-01-03 23:27 ` [PATCH net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter Sowmini Varadhan
2017-01-04 14:27   ` Willem de Bruijn
2017-01-03 23:27 ` [PATCH net-next 2/2] tools: psock_tpacket: verify that packet was received on lo before counting it Sowmini Varadhan
2017-01-04 14:30   ` Willem de Bruijn
2017-01-04 14:44     ` Sowmini Varadhan [this message]
2017-01-04 15:03       ` Willem de Bruijn
2017-01-04 15:13         ` Sowmini Varadhan
2017-01-04 16:07           ` Willem de Bruijn
2017-01-04 16:12             ` Sowmini Varadhan
2017-01-04 16:24               ` Willem de Bruijn
2017-01-04 16:27                 ` Sowmini Varadhan

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=20170104144424.GD9641@oracle.com \
    --to=sowmini.varadhan@oracle.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.