* Why is packet socket checked before bridge in netif_receive_skb?
@ 2005-07-26 18:03 Simon Barber
2005-07-26 18:18 ` John W. Linville
2005-07-26 19:58 ` David S. Miller
0 siblings, 2 replies; 6+ messages in thread
From: Simon Barber @ 2005-07-26 18:03 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
In netif_receive_skb there is code that checks the ptype_all handlers
(protocol handlers that want to handle all protocol types) before the
bridge hook, and code to check the specific protocol handlers after the
bridge hook.
The protocol handlers are also used to implement packet sockets. - Why
is the all handler checked before the bridge hook?
(I'm reading code from 2.4.26).
Simon
[-- Attachment #2: Type: text/html, Size: 1315 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Why is packet socket checked before bridge in netif_receive_skb?
@ 2005-07-26 18:25 Simon Barber
0 siblings, 0 replies; 6+ messages in thread
From: Simon Barber @ 2005-07-26 18:25 UTC (permalink / raw)
To: John W. Linville; +Cc: netdev
The odd thing is that the 'all protocols' handlers are checked before
the bridge hook, but the protocol type specific handlers are checked
after. Hence if you bind your packet socket to 'all' protocols you get
packets before bridging, but if you bind to a specific protocol you get
packets after the bridge hook.
Simon
-----Original Message-----
From: John W. Linville [mailto:linville@tuxdriver.com]
Sent: Tuesday, July 26, 2005 11:19 AM
To: Simon Barber
Cc: netdev@oss.sgi.com
Subject: Re: Why is packet socket checked before bridge in
netif_receive_skb?
On Tue, Jul 26, 2005 at 11:03:17AM -0700, Simon Barber wrote:
> The protocol handlers are also used to implement packet sockets. - Why
> is the all handler checked before the bridge hook?
Perhaps so that one can look at frames entering on a specific interface
rather than the bridge as a whole?
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Why is packet socket checked before bridge in netif_receive_skb?
@ 2005-07-26 21:22 Simon Barber
0 siblings, 0 replies; 6+ messages in thread
From: Simon Barber @ 2005-07-26 21:22 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
Ok - and I'm guessing that the behavior is different for the protocol
specific case (i.e. packet socket bound to a specific protocol type)
because no application has needed it to be the same? (IE sniffers
normally bind to all protocols, and protocol specific apps like DHCP
servers don't need to see frames before the bridge hook - they would
normally see them on the brige itself).
Simon
-----Original Message-----
From: David S. Miller [mailto:davem@davemloft.net]
Sent: Tuesday, July 26, 2005 12:59 PM
To: Simon Barber
Cc: netdev@oss.sgi.com
Subject: Re: Why is packet socket checked before bridge in
netif_receive_skb?
From: "Simon Barber" <simon@devicescape.com>
Subject: Why is packet socket checked before bridge in
netif_receive_skb?
Date: Tue, 26 Jul 2005 11:03:17 -0700
> The protocol handlers are also used to implement packet sockets. - Why
> is the all handler checked before the bridge hook?
Because we want packet sniffers to see the packet before the bridging
layer decapsulates it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Why is packet socket checked before bridge in netif_receive_skb?
@ 2005-08-02 18:30 Simon Barber
0 siblings, 0 replies; 6+ messages in thread
From: Simon Barber @ 2005-08-02 18:30 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
Ah - OK, so I guess it is an artifact of the reuse of the protocol
handler structures that means that some packet sockets see frames before
the bridge and others after. I guess this doesn't cause any problems.
Simon
-----Original Message-----
From: David S. Miller [mailto:davem@davemloft.net]
Sent: Tuesday, July 26, 2005 12:59 PM
To: Simon Barber
Cc: netdev@oss.sgi.com
Subject: Re: Why is packet socket checked before bridge in
netif_receive_skb?
From: "Simon Barber" <simon@devicescape.com>
Subject: Why is packet socket checked before bridge in
netif_receive_skb?
Date: Tue, 26 Jul 2005 11:03:17 -0700
> The protocol handlers are also used to implement packet sockets. - Why
> is the all handler checked before the bridge hook?
Because we want packet sniffers to see the packet before the
bridging layer decapsulates it.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-08-02 18:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-26 18:03 Why is packet socket checked before bridge in netif_receive_skb? Simon Barber
2005-07-26 18:18 ` John W. Linville
2005-07-26 19:58 ` David S. Miller
-- strict thread matches above, loose matches on Subject: below --
2005-07-26 18:25 Simon Barber
2005-07-26 21:22 Simon Barber
2005-08-02 18:30 Simon Barber
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).