aboutsummaryrefslogtreecommitdiff
path: root/xt_FULLCONENAT.c
diff options
context:
space:
mode:
Diffstat (limited to 'xt_FULLCONENAT.c')
-rw-r--r--xt_FULLCONENAT.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xt_FULLCONENAT.c b/xt_FULLCONENAT.c
index 9e52eba..8555b54 100644
--- a/xt_FULLCONENAT.c
+++ b/xt_FULLCONENAT.c
@@ -590,9 +590,14 @@ static unsigned int fullconenat_tg(struct sk_buff *skb, const struct xt_action_p
}
}
- new_ip = get_device_ip(skb->dev);
- newrange.min_addr.ip = new_ip;
- newrange.max_addr.ip = new_ip;
+ if(mr->range[0].flags & NF_NAT_RANGE_MAP_IPS) {
+ newrange.min_addr.ip = mr->range[0].min_ip;
+ newrange.max_addr.ip = mr->range[0].max_ip;
+ } else {
+ new_ip = get_device_ip(skb->dev);
+ newrange.min_addr.ip = new_ip;
+ newrange.max_addr.ip = new_ip;
+ }
/* do SNAT now */
ret = nf_nat_setup_info(ct, &newrange, HOOK2MANIP(xt_hooknum(par)));