Skip to content

Commit b3d54b3

Browse files
jengelhummakynes
authored andcommitted
netfilter: combine ipt_NETMAP and ip6t_NETMAP
Combine more modules since the actual code is so small anyway that the kmod metadata and the module in its loaded state totally outweighs the combined actual code size. IP_NF_TARGET_NETMAP becomes a compat option; IP6_NF_TARGET_NETMAP is completely eliminated since it has not see a release yet. Signed-off-by: Jan Engelhardt <[email protected]> Acked-by: Patrick McHardy <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 136251d commit b3d54b3

File tree

9 files changed

+181
-212
lines changed

9 files changed

+181
-212
lines changed

net/ipv4/netfilter/Kconfig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,11 @@ config IP_NF_TARGET_MASQUERADE
172172
config IP_NF_TARGET_NETMAP
173173
tristate "NETMAP target support"
174174
depends on NETFILTER_ADVANCED
175-
help
176-
NETMAP is an implementation of static 1:1 NAT mapping of network
177-
addresses. It maps the network address part, while keeping the host
178-
address part intact.
179-
180-
To compile it as a module, choose M here. If unsure, say N.
175+
select NETFILTER_XT_TARGET_NETMAP
176+
---help---
177+
This is a backwards-compat option for the user's convenience
178+
(e.g. when running oldconfig). It selects
179+
CONFIG_NETFILTER_XT_TARGET_NETMAP.
181180

182181
config IP_NF_TARGET_REDIRECT
183182
tristate "REDIRECT target support"

net/ipv4/netfilter/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ obj-$(CONFIG_IP_NF_MATCH_RPFILTER) += ipt_rpfilter.o
4545
obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o
4646
obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
4747
obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
48-
obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o
4948
obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
5049
obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
5150
obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o

net/ipv4/netfilter/ipt_NETMAP.c

Lines changed: 0 additions & 101 deletions
This file was deleted.

net/ipv6/netfilter/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,6 @@ config IP6_NF_TARGET_MASQUERADE
209209

210210
To compile it as a module, choose M here. If unsure, say N.
211211

212-
config IP6_NF_TARGET_NETMAP
213-
tristate "NETMAP target support"
214-
help
215-
NETMAP is an implementation of static 1:1 NAT mapping of network
216-
addresses. It maps the network address part, while keeping the host
217-
address part intact.
218-
219-
To compile it as a module, choose M here. If unsure, say N.
220-
221212
config IP6_NF_TARGET_REDIRECT
222213
tristate "REDIRECT target support"
223214
help

net/ipv6/netfilter/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o
3535

3636
# targets
3737
obj-$(CONFIG_IP6_NF_TARGET_MASQUERADE) += ip6t_MASQUERADE.o
38-
obj-$(CONFIG_IP6_NF_TARGET_NETMAP) += ip6t_NETMAP.o
3938
obj-$(CONFIG_IP6_NF_TARGET_NPT) += ip6t_NPT.o
4039
obj-$(CONFIG_IP6_NF_TARGET_REDIRECT) += ip6t_REDIRECT.o
4140
obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o

net/ipv6/netfilter/ip6t_NETMAP.c

Lines changed: 0 additions & 94 deletions
This file was deleted.

net/netfilter/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,16 @@ config NETFILTER_XT_TARGET_MARK
648648
(e.g. when running oldconfig). It selects
649649
CONFIG_NETFILTER_XT_MARK (combined mark/MARK module).
650650

651+
config NETFILTER_XT_TARGET_NETMAP
652+
tristate '"NETMAP" target support'
653+
depends on NF_NAT
654+
---help---
655+
NETMAP is an implementation of static 1:1 NAT mapping of network
656+
addresses. It maps the network address part, while keeping the host
657+
address part intact.
658+
659+
To compile it as a module, choose M here. If unsure, say N.
660+
651661
config NETFILTER_XT_TARGET_NFLOG
652662
tristate '"NFLOG" target support'
653663
default m if NETFILTER_ADVANCED=n

net/netfilter/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL.o
8383
obj-$(CONFIG_NETFILTER_XT_TARGET_HMARK) += xt_HMARK.o
8484
obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
8585
obj-$(CONFIG_NETFILTER_XT_TARGET_LOG) += xt_LOG.o
86+
obj-$(CONFIG_NETFILTER_XT_TARGET_NETMAP) += xt_NETMAP.o
8687
obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o
8788
obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
8889
obj-$(CONFIG_NETFILTER_XT_TARGET_RATEEST) += xt_RATEEST.o

0 commit comments

Comments
 (0)