lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0701040240230.29472@localhost.localdomain>
Date:	Thu, 4 Jan 2007 02:40:38 -0500 (EST)
From:	"Robert P. J. Day" <rpjday@...dspring.com>
To:	Andrew Morton <akpm@...l.org>
cc:	Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Simplify some code to use the container_of() macro.

On Wed, 3 Jan 2007, Andrew Morton wrote:

> On Sun, 31 Dec 2006 15:55:22 -0500 (EST)
> "Robert P. J. Day" <rpjday@...dspring.com> 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.

i was quite sure i had.  i'll take another look at it.

rday
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ