Re: bug in 2.1.89 include/net/sock.h?

Bill Hawes (whawes@star.net)
Sat, 07 Mar 1998 21:41:45 -0500


Alan Cox wrote:

> I dont believe this is correct. The packet will be freed if the filter fails
> and this itself will correct the memory count for the packet.

Hi Alan,

There are some places where the skb->sk pointer is cleared before calling
kfree_skb after a sock_queue_rcv_skb failure, so in this case the memory space
would not get credited back to the socket. I'm not sure which is the error here,
but unless the filtering code specifically needs the skb to be assigned to a
socket, it makes more sense to me not to set the sock ownership until we're sure
the skb will be queued there.

I.e., if the socket has refused to queue the skb, the skb should remain
unassigned until another socket queues it.

Regards,
Bill

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu