Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3f644fc authored by Patrick McHardy's avatar Patrick McHardy Committed by Pablo Neira Ayuso
Browse files

netfilter: ip6tables: add MASQUERADE target



Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 58a317f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
						 int strict);

extern int			ipv6_dev_get_saddr(struct net *net,
					       struct net_device *dev,
					       const struct net_device *dev,
					       const struct in6_addr *daddr,
					       unsigned int srcprefs,
					       struct in6_addr *saddr);
+3 −1
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ struct nf_conn_nat {
	struct nf_conn *ct;
	union nf_conntrack_nat_help help;
#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
    defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE)
    defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) || \
    defined(CONFIG_IP6_NF_TARGET_MASQUERADE) || \
    defined(CONFIG_IP6_NF_TARGET_MASQUERADE_MODULE)
	int masq_index;
#endif
};
+2 −1
Original line number Diff line number Diff line
@@ -99,7 +99,8 @@ device_cmp(struct nf_conn *i, void *ifindex)

	if (!nat)
		return 0;

	if (nf_ct_l3num(i) != NFPROTO_IPV4)
		return 0;
	return nat->masq_index == (int)(long)ifindex;
}

+1 −1
Original line number Diff line number Diff line
@@ -1093,7 +1093,7 @@ static int ipv6_get_saddr_eval(struct net *net,
	return ret;
}

int ipv6_dev_get_saddr(struct net *net, struct net_device *dst_dev,
int ipv6_dev_get_saddr(struct net *net, const struct net_device *dst_dev,
		       const struct in6_addr *daddr, unsigned int prefs,
		       struct in6_addr *saddr)
{
+12 −0
Original line number Diff line number Diff line
@@ -144,6 +144,18 @@ config IP6_NF_TARGET_HL
	(e.g. when running oldconfig). It selects
	CONFIG_NETFILTER_XT_TARGET_HL.

config IP6_NF_TARGET_MASQUERADE
	tristate "MASQUERADE target support"
	depends on NF_NAT_IPV6
	help
	  Masquerading is a special case of NAT: all outgoing connections are
	  changed to seem to come from a particular interface's address, and
	  if the interface goes down, those connections are lost.  This is
	  only useful for dialup accounts with dynamic IP address (ie. your IP
	  address will be different on next dialup).

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

config IP6_NF_FILTER
	tristate "Packet filtering"
	default m if NETFILTER_ADVANCED=n
Loading