public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Edgar Toernig <froese@gmx.de>
To: Joris van Rantwijk <joris@deadlock.et.tudelft.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Bind to protocol with AF_PACKET doesn't work for outgoing packets
Date: Fri, 02 Nov 2001 03:26:27 +0100	[thread overview]
Message-ID: <3BE20453.22427ECB@gmx.de> (raw)
In-Reply-To: <Pine.LNX.4.21.0111010944050.16656-100000@deadlock.et.tudelft.nl>

Joris van Rantwijk wrote:
> 
> I'm trying to see outgoing network packets through the AF_PACKET
> interface. This works as long as I bind the packet socket with
> sll_protocol==htons(ETH_P_ALL).  I would expect that I can filter
> on IP packets by binding to sll_protocol==htons(ETH_P_IP), but when
> I try it I suddenly see only the incoming packets and no outgoing at all.

Deja vu? :-)  See this message:

---------------------
> Subject: Re: PF_PACKET, ETH_P_IP does not catch outgoing packets.
> From: kuznet@ms2.inr.ac.ru
> Date: Thu, 23 Dec 1999 20:41:11 +0300 (MSK)
>
> Hello!
>
> > do not receive outgoing packets.  Just changing the
> > protocol to ETH_P_ALL (or a later bind with that proto)
> > will get all packets.  Is this intentional?  (I don't think
> > so *g*) 
>
> Yes, sort of. It is planned flaw in design. 8) 
>
>
> > Any idea for a quick fix?
>
> No, it is not very easy. If it were easy, it would be made. 8)
> 
> The problem is that bound to protocol sockets are not
> checked at output at all, only ETH_P_ALL ones are checked.
> We could check all, but it affects performance, because
> true protocols (looking exactly as packet socket) really
> need not it. The direction of compromise is not evident.
>
> Someone promised to think on this and repair at the end of 2.1,
> I even reserved sockopt PACKET_RECV_OUTPUT to switch it on/off,
> but, alas, I did not receive any patches.
>
> Alexey
-----------------------

Two years nobody cared.  Seems the BPF is good enough...

Ciao, ET.

  reply	other threads:[~2001-11-02  2:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-01  9:11 Bind to protocol with AF_PACKET doesn't work for outgoing packets Joris van Rantwijk
2001-11-02  2:26 ` Edgar Toernig [this message]
     [not found] <Pine.LNX.4.21.0111010944050.16656-100000@deadlock.et.tudelft.nl.suse.lists.linux.kernel>
2001-11-01 14:30 ` Andi Kleen
2001-11-01 15:18   ` Joris van Rantwijk
2001-11-01 16:46     ` Andi Kleen
2001-11-01 17:33   ` kuznet
2001-11-01 17:45     ` Andi Kleen
2001-11-01 18:09       ` kuznet
2001-11-01 18:21         ` Andi Kleen
2001-11-01 18:56           ` kuznet
2001-11-01 19:28             ` Andi Kleen
2001-11-01 19:48               ` kuznet

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=3BE20453.22427ECB@gmx.de \
    --to=froese@gmx.de \
    --cc=joris@deadlock.et.tudelft.nl \
    --cc=linux-kernel@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