From 9435c0e186aa9eadc0b7603024e2abf7842923c4 Mon Sep 17 00:00:00 2001 From: tingjunli <815314486@qq.com> Date: Wed, 7 Nov 2018 10:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E5=90=8E=E4=B8=A4=E6=AC=A1SNAT?= =?UTF-8?q?=E5=87=BA=E6=8E=A5=E5=8F=A3=E5=8F=98=E5=8C=96=E5=90=8E=EF=BC=8C?= =?UTF-8?q?CT=E8=A1=A8=E6=97=A0=E6=B3=95=E5=8F=8A=E6=97=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=B1=E6=95=88=E7=9A=84=E8=B7=9F=E8=B8=AA=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E5=AF=BC=E8=87=B4NAT=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xt_FULLCONENAT.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xt_FULLCONENAT.c b/xt_FULLCONENAT.c index 9e52eba..595e766 100644 --- a/xt_FULLCONENAT.c +++ b/xt_FULLCONENAT.c @@ -467,6 +467,7 @@ static unsigned int fullconenat_tg(struct sk_buff *skb, const struct xt_action_p struct nf_conn *ct; enum ip_conntrack_info ctinfo; struct nf_conntrack_tuple *ct_tuple, *ct_tuple_origin; + struct nf_conn_nat *nat; struct net_device *net_dev; @@ -496,6 +497,7 @@ static unsigned int fullconenat_tg(struct sk_buff *skb, const struct xt_action_p ct = nf_ct_get(skb, &ctinfo); net = nf_ct_net(ct); zone = nf_ct_zone(ct); + nat = nfct_nat(ct); memset(&newrange.min_addr, 0, sizeof(newrange.min_addr)); memset(&newrange.max_addr, 0, sizeof(newrange.max_addr)); @@ -590,6 +592,8 @@ static unsigned int fullconenat_tg(struct sk_buff *skb, const struct xt_action_p } } + nat->masq_index = ifindex; + new_ip = get_device_ip(skb->dev); newrange.min_addr.ip = new_ip; newrange.max_addr.ip = new_ip;