netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH?] Fix sniffing of ARP replies
@ 2003-10-15 17:11 Petr Vandrovec
  2003-10-16  3:47 ` David S. Miller
  2003-10-17  7:10 ` David S. Miller
  0 siblings, 2 replies; 9+ messages in thread
From: Petr Vandrovec @ 2003-10-15 17:11 UTC (permalink / raw)
  To: davem; +Cc: netdev

Hi Dave,
  after recent changes in packet_type interface I stopped setting
af_packet_priv - as you told that it is only for AF_PACKET, for nobody
else. And - things stopped working.

  After some debugging I found that there are skb's with ->sk == NULL -
namely ARP replies - and if af_packet_priv == NULL, these skbs are not
delivered to the registered ptype.

  Is change below correct, or should I simple set af_packet_priv to
non-NULL value, like I did before (and like I have to do it again for
older kernels, in the light of problems I'm seeing now)?
					Thanks,
						Petr Vandrovec


diff -urdN linux/net/core/dev.c linux/net/core/dev.c
--- linux/net/core/dev.c	2003-10-15 14:05:23.000000000 +0000
+++ linux/net/core/dev.c	2003-10-15 16:52:41.000000000 +0000
@@ -942,7 +942,8 @@
 		 * they originated from - MvS (miquels@drinkel.ow.org)
 		 */
 		if ((ptype->dev == dev || !ptype->dev) &&
-		    (struct sock *)ptype->af_packet_priv != skb->sk) {
+		    (ptype->af_packet_priv == NULL ||
+		     (struct sock *)ptype->af_packet_priv != skb->sk)) {
 			struct sk_buff *skb2= skb_clone(skb, GFP_ATOMIC);
 			if (!skb2)
 				break;

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [PATCH?] Fix sniffing of ARP replies
@ 2003-10-16 10:07 Petr Vandrovec
  2003-10-16 22:21 ` David S. Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vandrovec @ 2003-10-16 10:07 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

On 15 Oct 03 at 20:47, David S. Miller wrote:
> On Wed, 15 Oct 2003 19:11:12 +0200
> Petr Vandrovec <vandrove@vc.cvut.cz> wrote:
> 
> >   after recent changes in packet_type interface I stopped setting
> > af_packet_priv - as you told that it is only for AF_PACKET, for nobody
> > else. And - things stopped working.
> 
> "Where" did you stop doing this?

vmnet. http://platan.vc.cvut.cz/ftp/pub/vmware/vmware-any-any-update42.tar.gz,
vmnet.tar -> bridge.c.
 
> Nothing in the current kernel should be broken at all by said
> changes I did to 2.6.x
> 
> If it has broken something you are working on external to the tree
> you have to say what it is.  I can only guess that it's making
> assumptions that never truly existed.

It behaves same way it behaved. But recently you renamed packet_type.data
to packet_type.af_packet_priv, saying that af_packet_priv should be used
only by AF_PACKET code, by nobody else. So I trusted you, removed
packet_type.data (and packet_type.af_packet_priv) references from the
code - and things stopped working, as with af_packet_priv==NULL ARP
replies are not delivered to the registered packet_type callback, as
these packets match skb->sk == pt->af_packet_priv for af_packet_priv == NULL.

I can of course set 'af_packet_priv' to some non-NULL value - but in such 
case I do not understand why you renamed it, if semantic is same as it was 
before.
                                                    Best regards,
                                                        Petr Vandrovec
                                                        vandrove@vc.cvut.cz
                                                        

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-10-17  7:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-15 17:11 [PATCH?] Fix sniffing of ARP replies Petr Vandrovec
2003-10-16  3:47 ` David S. Miller
2003-10-17  7:10 ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-10-16 10:07 Petr Vandrovec
2003-10-16 22:21 ` David S. Miller
2003-10-16 22:41   ` Joe Perches
2003-10-16 22:45     ` David S. Miller
2003-10-16 23:48       ` Petr Vandrovec
2003-10-17  6:55         ` David S. Miller

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).