laudney@xxxxxxxx said:
> After reading the patch, I found some problems.
> 1. The patch doesn't allow "protocol == 0" either, even exit the
> funtion at an earlier stage by shifting the place of
> "if (protocol == 0)
> goto out_unlock;"
> forward.
That's the point. The patch allows one to remove a socket from the
ptype_all list (or ptype_base hash) after it's been added.
Userspace can make the socket active again by binding to an actual
protocol, like ETH_P_ALL.
> 2. all the bulk changes to the codes of
> if(dev) {
> ..
> }
> are simply an optimization. No content change at all!!
true. maybe I should remove that; I just thought it was just ugly having
the same block in two places when one would do.
> /* since protocol == 0, no hook should exist */
> if (protocol == 0)
> sk->protinfo.af_packet->running = 0;
this is wrong. af_packet->running indicates whether the socket is in the
ptype_all list or the ptype_base hash (read the rest of af_packet.c).
You break this here by setting running to 0 without actually removing
it.
--
Jason Lunz Trellis Network Security
j@xxxxxxxxxxxxxx http://www.trellisinc.com/
|