netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
To: netdev@vger.kernel.org
Subject: PF_PACKET + bind() to proto + outbound packets
Date: Fri, 14 May 2010 02:14:35 +0100	[thread overview]
Message-ID: <20100514011435.GL18613@cel.leo> (raw)

[-- Attachment #1: Type: text/plain, Size: 868 bytes --]

I'm writing a small traffic watching program, to capture IPv4 packets.

If I have a PF_PACKET socket bound to no particular protocol it sees
both inbound and outbound packets; I can then apply a BPF filter for
just one protocol (i.e. IPv4).

But if instead I bind the socket to the IPv4 protocol specifically, it
no longer sees any outbound packets created by the machine, only inbound
ones.

Is there perhaps some ioctl or sockopt I could enable, to see these
outbound packets too?

Further, would there actually be much difference in practice, in terms
of performance, abilities, etc... even if this were an option turned on?
What's the preferred method of snooping on all of the machine's, for
example, IPv4 traffic?

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

                 reply	other threads:[~2010-05-14  1:14 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=20100514011435.GL18613@cel.leo \
    --to=leonerd@leonerd.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).