commit ecc4508e476e4325e747dad5d86c03248ed16271 Author: Patrick McHardy Date: Sat Sep 8 19:45:12 2012 +0200 netfilter: fix xt_nat link order Cong Wang reported a NULL dereference in xt_register_target() It turns out xt_nat_init() was called before xt_init(), so xt array was not yet setup. Move xt_nat down in the Makefile to avoid initialization before x_tables is initialized. Based on patch from Eric Dumazet. Reported-by: Cong Wang Signed-off-by: Patrick McHardy diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile index 98244d4..6ad6616 100644 --- a/net/netfilter/Makefile +++ b/net/netfilter/Makefile @@ -47,7 +47,6 @@ nf_nat-y := nf_nat_core.o nf_nat_proto_unknown.o nf_nat_proto_common.o \ nf_nat_proto_udp.o nf_nat_proto_tcp.o nf_nat_helper.o obj-$(CONFIG_NF_NAT) += nf_nat.o -obj-$(CONFIG_NF_NAT) += xt_nat.o # NAT protocols (nf_nat) obj-$(CONFIG_NF_NAT_PROTO_DCCP) += nf_nat_proto_dccp.o @@ -93,6 +92,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP) += xt_TCPOPTSTRIP.o obj-$(CONFIG_NETFILTER_XT_TARGET_TEE) += xt_TEE.o obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o obj-$(CONFIG_NETFILTER_XT_TARGET_IDLETIMER) += xt_IDLETIMER.o +obj-$(CONFIG_NF_NAT) += xt_nat.o # matches obj-$(CONFIG_NETFILTER_XT_MATCH_ADDRTYPE) += xt_addrtype.o