Skip to content

Commit 2cbc78a

Browse files
jengelhummakynes
authored andcommitted
netfilter: combine ipt_REDIRECT and ip6t_REDIRECT
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_REDIRECT becomes a compat option; IP6_NF_TARGET_REDIRECT 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 b3d54b3 commit 2cbc78a

File tree

9 files changed

+207
-230
lines changed

9 files changed

+207
-230
lines changed

net/ipv4/netfilter/Kconfig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,11 @@ config IP_NF_TARGET_NETMAP
181181
config IP_NF_TARGET_REDIRECT
182182
tristate "REDIRECT target support"
183183
depends on NETFILTER_ADVANCED
184-
help
185-
REDIRECT is a special case of NAT: all incoming connections are
186-
mapped onto the incoming interface's address, causing the packets to
187-
come to the local machine instead of passing through. This is
188-
useful for transparent proxies.
189-
190-
To compile it as a module, choose M here. If unsure, say N.
184+
select NETFILTER_XT_TARGET_REDIRECT
185+
---help---
186+
This is a backwards-compat option for the user's convenience
187+
(e.g. when running oldconfig). It selects
188+
CONFIG_NETFILTER_XT_TARGET_REDIRECT.
191189

192190
endif
193191

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_REDIRECT) += ipt_REDIRECT.o
4948
obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
5049
obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o
5150

net/ipv4/netfilter/ipt_REDIRECT.c

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

net/ipv6/netfilter/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +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_REDIRECT
213-
tristate "REDIRECT target support"
214-
help
215-
REDIRECT is a special case of NAT: all incoming connections are
216-
mapped onto the incoming interface's address, causing the packets to
217-
come to the local machine instead of passing through. This is
218-
useful for transparent proxies.
219-
220-
To compile it as a module, choose M here. If unsure, say N.
221-
222212
config IP6_NF_TARGET_NPT
223213
tristate "NPT (Network Prefix translation) target support"
224214
help

net/ipv6/netfilter/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o
3636
# targets
3737
obj-$(CONFIG_IP6_NF_TARGET_MASQUERADE) += ip6t_MASQUERADE.o
3838
obj-$(CONFIG_IP6_NF_TARGET_NPT) += ip6t_NPT.o
39-
obj-$(CONFIG_IP6_NF_TARGET_REDIRECT) += ip6t_REDIRECT.o
4039
obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o

net/ipv6/netfilter/ip6t_REDIRECT.c

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

net/netfilter/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,17 @@ config NETFILTER_XT_TARGET_RATEEST
690690

691691
To compile it as a module, choose M here. If unsure, say N.
692692

693+
config NETFILTER_XT_TARGET_REDIRECT
694+
tristate "REDIRECT target support"
695+
depends on NF_NAT
696+
---help---
697+
REDIRECT is a special case of NAT: all incoming connections are
698+
mapped onto the incoming interface's address, causing the packets to
699+
come to the local machine instead of passing through. This is
700+
useful for transparent proxies.
701+
702+
To compile it as a module, choose M here. If unsure, say N.
703+
693704
config NETFILTER_XT_TARGET_TEE
694705
tristate '"TEE" - packet cloning to alternate destination'
695706
depends on NETFILTER_ADVANCED

net/netfilter/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_NETMAP) += xt_NETMAP.o
8787
obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o
8888
obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
8989
obj-$(CONFIG_NETFILTER_XT_TARGET_RATEEST) += xt_RATEEST.o
90+
obj-$(CONFIG_NETFILTER_XT_TARGET_REDIRECT) += xt_REDIRECT.o
9091
obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o
9192
obj-$(CONFIG_NETFILTER_XT_TARGET_TPROXY) += xt_TPROXY.o
9293
obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o

0 commit comments

Comments
 (0)