Bind to protocol with AF_PACKET doesn't work for outgoing packets

From: Joris van Rantwijk (joris@deadlock.et.tudelft.nl)
Date: Thu Nov 01 2001 - 04:11:13 EST


Hello.

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.

I suspect this is because dev_queue_xmit_nit() only walks the ptype_all
chain (with the ETH_P_ALL taps) and doesn't process the ptype_base[]
lists. net_rx_action() processes ptype_all as well as ptype_base, so
it works fine for incoming packets.

So... Shouldn't dev_queue_xmit_nit() also process ptype_base then ?
Or is this just complete cluelessness on my part ?
(I'm rather new to this so I don't know how it's supposed to work)

I tried this with linux-2.4.12, but it seems relevant to 2.2.x
and 2.0.x as well.

Thanks,
  Joris van Rantwijk
joris@deadlock.et.tudelft.nl - http://deadlock.et.tudelft.nl/~joris/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Nov 07 2001 - 21:00:14 EST