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

kuznet@ms2.inr.ac.ru
Thu, 1 Nov 2001 22:48:13 +0300 (MSK)


Hello!

> Just to have an symmetric API. Everything else is too ugly to explain
> in manpages ;)

Explaining is easy. Blah-blah-blah... Sockets bound to ETH_P_ALL
are able to get copy of output packets which is useful f.e.
for packet sniffers (ref to [libpacp],[tcpdump]). In later kernels
this can be disabled with option PACKET_NOOUTPUT. When this option
is not supported user of packet socket bound to ETH_P_ALL has to filter
output packets at user level checking for pkt_type == PACKET_OUTPUT
or using an equivalent BPF applet.

> That would require changing/breaking PF_PACKET, no?

No. Ideally the option could be PACKET_GRAB_OUTPUT and be disabled
by default (for symmetry :-)). But as soon as it was forgotten,
it has to be enabled by default.

Alexey
-
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/