Re: [PATCH] Simplify some code to use the container_of() macro.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 31 Dec 2006 15:55:22 -0500 (EST)
"Robert P. J. Day" <[email protected]> wrote:

> --- a/net/ipv4/netfilter/nf_nat_core.c
> +++ b/net/ipv4/netfilter/nf_nat_core.c
> @@ -168,7 +168,7 @@ find_appropriate_src(const struct nf_conntrack_tuple *tuple,
> 
>  	read_lock_bh(&nf_nat_lock);
>  	list_for_each_entry(nat, &bysource[h], info.bysource) {
> -		ct = (struct nf_conn *)((char *)nat - offsetof(struct nf_conn, data));
> +		ct = container_of(nat, struct nf_conn, data);

This one isn't right.  Please always carefully compile-test these things.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux