netfilter: nf_tables: fix wrong type for flags variable in newelem

Noted while presenting nftables during the NFWS2013.

Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: make sure the compiler does not reorder gencursor caching

I needed to modify gencursor and genctr to make it work with typeof in
ACCESS_ONCE, otherwise compilation fails.

Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: fix compilation when nf-netlink is a module

nftables uses nfnl_[un]lock() and thus depends on CONFIG_NETFILTER_NETLINK.
It's not possible to have nftables built-in when CONFIG_NETFILTER_NETLINK is set
to m.

I also add a dependancy between NETFILTER_XTABLES and NFT_COMPAT instead of
automatically set NETFILTER_XTABLES when NFT_COMPAT is set. This is to avoid a
circular dependency:

net/netfilter/Kconfig:432:error: recursive dependency detected!
net/netfilter/Kconfig:432:	symbol NF_TABLES depends on NETFILTER_NETLINK
net/netfilter/Kconfig:4:	symbol NETFILTER_NETLINK is selected by NETFILTER_NETLINK_ACCT
net/netfilter/Kconfig:7:	symbol NETFILTER_NETLINK_ACCT is selected by NETFILTER_XT_MATCH_NFACCT
net/netfilter/Kconfig:1087:	symbol NETFILTER_XT_MATCH_NFACCT depends on NETFILTER_XTABLES
net/netfilter/Kconfig:425:	symbol NETFILTER_XTABLES is selected by NFT_COMPAT
net/netfilter/Kconfig:478:	symbol NFT_COMPAT depends on NF_TABLES

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: nf_tables: nft_ct: fix crash with invalid packets

We have to check first if the packet is invalid, ie. ct is NULL.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>