Re: [PATCH V2] NETFILTER: replace list_for_each with list_for_each_entry

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

 



Li Zefan wrote:
This patch replaces list_for_each with list_for_each_entry, and
consequently fixes a bug too.

Things like this is wrong:

	list_for_each(i, &nf_sockopts) {
		struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i;

It makes the assumption that list is the first member of struct
nf_sockopt_ops, so the ptr casting works. But if one day the structure
changes, for example, like this:

So far its not a bug, so I've applied it without that description.
Thanks.

 net/netfilter/nf_sockopt.c         |   13 ++++---------

And removed that part since you're the third person within two
weeks to send an identical patch :) Please always base your
patches on Linus' latest -git tree or Dave's networking tree
for the next version once it opens.

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux