mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
Update fullconenat.patch
This commit is contained in:
parent
65678acb5e
commit
4b842f527d
1 changed files with 25 additions and 17 deletions
|
@ -11,7 +11,7 @@
|
||||||
struct list_head cthelpers;
|
struct list_head cthelpers;
|
||||||
--- a/zones.c
|
--- a/zones.c
|
||||||
+++ b/zones.c
|
+++ b/zones.c
|
||||||
@@ -77,6 +77,8 @@ const struct fw3_option fw3_zone_opts[]
|
@@ -77,6 +77,8 @@ const struct fw3_option fw3_zone_opts[] = {
|
||||||
FW3_LIST("masq_src", network, zone, masq_src),
|
FW3_LIST("masq_src", network, zone, masq_src),
|
||||||
FW3_LIST("masq_dest", network, zone, masq_dest),
|
FW3_LIST("masq_dest", network, zone, masq_dest),
|
||||||
|
|
||||||
|
@ -20,11 +20,14 @@
|
||||||
FW3_OPT("extra", string, zone, extra_src),
|
FW3_OPT("extra", string, zone, extra_src),
|
||||||
FW3_OPT("extra_src", string, zone, extra_src),
|
FW3_OPT("extra_src", string, zone, extra_src),
|
||||||
FW3_OPT("extra_dest", string, zone, extra_dest),
|
FW3_OPT("extra_dest", string, zone, extra_dest),
|
||||||
@@ -709,7 +711,16 @@ print_zone_rule(struct fw3_ipt_handle *h
|
@@ -753,10 +755,21 @@ print_zone_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
|
||||||
(mdest = next_addr(mdest, &zone->masq_dest,
|
|
||||||
handle->family, false)) || first_dest;
|
handle->family, false)) || first_dest;
|
||||||
first_dest = false)
|
first_dest = false)
|
||||||
- {
|
{
|
||||||
|
- r = fw3_ipt_rule_new(handle);
|
||||||
|
- fw3_ipt_rule_src_dest(r, msrc, mdest);
|
||||||
|
- fw3_ipt_rule_target(r, "MASQUERADE");
|
||||||
|
- fw3_ipt_rule_append(r, "zone_%s_postrouting", zone->name);
|
||||||
+ if (zone->fullcone && (access("/usr/lib/iptables/libipt_FULLCONENAT.so", 0) == 0)) {
|
+ if (zone->fullcone && (access("/usr/lib/iptables/libipt_FULLCONENAT.so", 0) == 0)) {
|
||||||
+ r = fw3_ipt_rule_new(handle);
|
+ r = fw3_ipt_rule_new(handle);
|
||||||
+ fw3_ipt_rule_src_dest(r, msrc, mdest);
|
+ fw3_ipt_rule_src_dest(r, msrc, mdest);
|
||||||
|
@ -35,6 +38,11 @@
|
||||||
+ fw3_ipt_rule_target(r, "FULLCONENAT");
|
+ fw3_ipt_rule_target(r, "FULLCONENAT");
|
||||||
+ fw3_ipt_rule_append(r, "zone_%s_prerouting", zone->name);
|
+ fw3_ipt_rule_append(r, "zone_%s_prerouting", zone->name);
|
||||||
+ } else {
|
+ } else {
|
||||||
r = fw3_ipt_rule_new(handle);
|
+ r = fw3_ipt_rule_new(handle);
|
||||||
fw3_ipt_rule_src_dest(r, msrc, mdest);
|
+ fw3_ipt_rule_src_dest(r, msrc, mdest);
|
||||||
fw3_ipt_rule_target(r, "MASQUERADE");
|
+ fw3_ipt_rule_target(r, "MASQUERADE");
|
||||||
|
+ fw3_ipt_rule_append(r, "zone_%s_postrouting", zone->name);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue