List Info

Thread: Re: nf_nat: Kills global 'destroy' operation




Re: nf_nat: Kills global 'destroy' operation
country flaguser name
Germany
2007-06-25 13:24:16
Yasuyuki KOZAKAI wrote:
> This kills the global 'destroy' operation which was
used by NAT.
> Instead it uses the extension infrastructure so that
multiple
> extensions can register own operations.


Applied, very nice 

>  
> +/* Noone using conntrack by the time this called. */
> +static void nf_nat_cleanup_conntrack(struct nf_conn
*ct)
> +{
> +	struct nf_conn_nat *nat = nf_ct_ext_find(ct,
NF_CT_EXT_NAT);
> +
> +	if (nat == NULL || nat->info.ct == NULL)
> +		return;


These conditions would actually be BUG()s, right?

> +
> +	NF_CT_ASSERT(nat->info.ct->status &
IPS_NAT_DONE_MASK);
> +
> +	write_lock_bh(&nf_nat_lock);
> +	list_del(&nat->info.bysource);
> +	nat->info.ct = NULL;
> +	write_unlock_bh(&nf_nat_lock);
> +}
> +


Re: nf_nat: Kills global 'destroy' operation
country flaguser name
Japan
2007-06-25 21:53:50
From: Patrick McHardy <kabertrash.net>
Date: Mon, 25 Jun 2007 20:24:16 +0200

> > +/* Noone using conntrack by the time this called.
*/
> > +static void nf_nat_cleanup_conntrack(struct
nf_conn *ct)
> > +{
> > +	struct nf_conn_nat *nat = nf_ct_ext_find(ct,
NF_CT_EXT_NAT);
> > +
> > +	if (nat == NULL || nat->info.ct == NULL)
> > +		return;
> 
> 
> These conditions would actually be BUG()s, right?

They can be NULL if the conntrack has not been confirmed
yet.

-- Yasuyuki Kozakai


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )