netfilter: nft_nat: fix family validation
authorPatrick McHardy <kaber@trash.net>
Fri, 7 Mar 2014 18:08:33 +0000 (19:08 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 8 Mar 2014 11:35:19 +0000 (12:35 +0100)
The family in the NAT expression is basically completely useless since
we have it available during runtime anyway. Nevertheless it is used to
decide the NAT family, so at least validate it properly. As we don't
support cross-family NAT, it needs to match the family of the table the
expression exists in.

Unfortunately we can't remove it completely since we need to dump it for
userspace (*sigh*), so at least reduce the memory waste.

Additionally clean up the module init function by removing useless
temporary variables.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_nat.c

Simple merge