Re: Shouldn't we be using alloc_skb/kfree_skb innet/ipv4/netfilter/ipt_recent.c::ip_recent_ctrl ?

From: David S. Miller
Date: Thu Jun 16 2005 - 17:56:05 EST

From: Jesper Juhl <juhl-lkml@xxxxxx>
Date: Fri, 17 Jun 2005 00:36:04 +0200 (CEST)

> I was just grep'ing through the source looking for places where skb's
> might be freed by plain kfree() and, amongst other things, I noticed
> net/ipv4/netfilter/ipt_recent.c::ip_recent_ctrl, where a struct sk_buff*
> is defined and then storage for it is allocated with kmalloc() and freed
> with kfree(), and I'm wondering if we shouldn't be using
> alloc_skb/kfree_skb instead (as pr the patch below)? Or is there some good
> reason for doing it the way it's currently done?

It's using it to send a dummy packet to the patch function.
It is gross, but it does work because it allocated it's own
private data area to skb->nh.iph.

Just leave it alone for now, ipt_recent is gross and full of many
errors and bug, and thus stands to have a rewrite. Patrick McHardy
said he will try to do that.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at