forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/coolsnowwolf/lede: Version update to R22.12.1 network: add brcm fullcone support from ASUS Merlin kernel 4.19 ustream-ssl: prevent unused crypto lib dependencies from being compiled ncurses: add package CPE ID libunwind: update to 1.6.2 libunwind: add ppc64 support libtool: update to 2.4.7 libnl: add PKG_CPE_ID libnl: update to 3.7.0 libnfnetlink: add PKG_CPE_ID libmnl: add PKG_CPE_ID elfutils: update to 1.88 gpio-button-hotplug: fix data race tools/xz: update to 5.2.9 build: config: cleanup impossible dependency logic
- Loading branch information
Showing
26 changed files
with
1,102 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
60 changes: 60 additions & 0 deletions
60
package/network/config/firewall/patches/101-bcm-fullconenat.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- a/defaults.c | ||
+++ b/defaults.c | ||
@@ -49,7 +49,7 @@ const struct fw3_option fw3_flag_opts[] | ||
FW3_OPT("synflood_rate", limit, defaults, syn_flood_rate), | ||
FW3_OPT("synflood_burst", int, defaults, syn_flood_rate.burst), | ||
|
||
- FW3_OPT("fullcone", bool, defaults, fullcone), | ||
+ FW3_OPT("fullcone", int, defaults, fullcone), | ||
|
||
FW3_OPT("tcp_syncookies", bool, defaults, tcp_syncookies), | ||
FW3_OPT("tcp_ecn", int, defaults, tcp_ecn), | ||
--- a/options.h | ||
+++ b/options.h | ||
@@ -98,6 +98,13 @@ enum fw3_reject_code | ||
__FW3_REJECT_CODE_MAX | ||
}; | ||
|
||
+enum fullcone_code | ||
+{ | ||
+ FULLCONE_DISABLED = 0, | ||
+ FULLCONE_CHION = 1, | ||
+ FULLCONE_BCM = 2, | ||
+}; | ||
+ | ||
extern const char *fw3_flag_names[__FW3_FLAG_MAX]; | ||
|
||
|
||
@@ -297,7 +304,7 @@ struct fw3_defaults | ||
enum fw3_reject_code any_reject_code; | ||
|
||
bool syn_flood; | ||
- bool fullcone; | ||
+ int fullcone; | ||
struct fw3_limit syn_flood_rate; | ||
|
||
bool tcp_syncookies; | ||
--- a/zones.c | ||
+++ b/zones.c | ||
@@ -757,7 +757,7 @@ print_zone_rule(struct fw3_ipt_handle *h | ||
r = fw3_ipt_rule_new(handle); | ||
fw3_ipt_rule_src_dest(r, msrc, mdest); | ||
/*FIXME: Workaround for FULLCONE-NAT*/ | ||
- if(defs->fullcone) | ||
+ if(defs->fullcone == FULLCONE_CHION) | ||
{ | ||
warn("%s will enable FULLCONE-NAT", zone->name); | ||
fw3_ipt_rule_target(r, "FULLCONENAT"); | ||
@@ -767,6 +767,12 @@ print_zone_rule(struct fw3_ipt_handle *h | ||
fw3_ipt_rule_target(r, "FULLCONENAT"); | ||
fw3_ipt_rule_append(r, "zone_%s_prerouting", zone->name); | ||
} | ||
+ else if (defs->fullcone == FULLCONE_BCM) | ||
+ { | ||
+ fw3_ipt_rule_target(r, "MASQUERADE"); | ||
+ fw3_ipt_rule_extra(r, "--mode fullcone"); | ||
+ fw3_ipt_rule_append(r, "zone_%s_postrouting", zone->name); | ||
+ } | ||
else | ||
{ | ||
fw3_ipt_rule_target(r, "MASQUERADE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
package/network/utils/iptables/patches/900-bcm-fullconenat.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- a/extensions/libipt_MASQUERADE.c | ||
+++ b/extensions/libipt_MASQUERADE.c | ||
@@ -11,6 +11,7 @@ | ||
enum { | ||
O_TO_PORTS = 0, | ||
O_RANDOM, | ||
+ O_MODE, | ||
O_RANDOM_FULLY, | ||
}; | ||
|
||
@@ -23,13 +24,16 @@ static void MASQUERADE_help(void) | ||
" --random\n" | ||
" Randomize source port.\n" | ||
" --random-fully\n" | ||
-" Fully randomize source port.\n"); | ||
+" Fully randomize source port.\n" | ||
+" --mode <fullcone|symmetric>\n" | ||
+" NAT mode.\n"); | ||
} | ||
|
||
static const struct xt_option_entry MASQUERADE_opts[] = { | ||
{.name = "to-ports", .id = O_TO_PORTS, .type = XTTYPE_STRING}, | ||
{.name = "random", .id = O_RANDOM, .type = XTTYPE_NONE}, | ||
{.name = "random-fully", .id = O_RANDOM_FULLY, .type = XTTYPE_NONE}, | ||
+ {.name = "mode", .id = O_MODE, .type = XTTYPE_STRING}, | ||
XTOPT_TABLEEND, | ||
}; | ||
|
||
@@ -90,6 +94,8 @@ static void MASQUERADE_parse(struct xt_o | ||
else | ||
portok = 0; | ||
|
||
+ mr->range[0].min_ip = 0; | ||
+ | ||
xtables_option_parse(cb); | ||
switch (cb->entry->id) { | ||
case O_TO_PORTS: | ||
@@ -104,6 +110,15 @@ static void MASQUERADE_parse(struct xt_o | ||
case O_RANDOM_FULLY: | ||
mr->range[0].flags |= NF_NAT_RANGE_PROTO_RANDOM_FULLY; | ||
break; | ||
+ case O_MODE: | ||
+ if (strcasecmp(cb->arg, "fullcone") == 0) | ||
+ mr->range[0].min_ip = 1; | ||
+ else if (strcasecmp(cb->arg, "symmetric") == 0) | ||
+ mr->range[0].min_ip = 0; | ||
+ else | ||
+ xtables_error(PARAMETER_PROBLEM, | ||
+ "Unknown mode %s", cb->arg); | ||
+ break; | ||
} | ||
} | ||
|
||
@@ -126,6 +141,9 @@ MASQUERADE_print(const void *ip, const s | ||
|
||
if (r->flags & NF_NAT_RANGE_PROTO_RANDOM_FULLY) | ||
printf(" random-fully"); | ||
+ | ||
+ if (r->min_ip == 1) | ||
+ printf(" mode: fullcone"); | ||
} | ||
|
||
static void | ||
@@ -145,6 +163,9 @@ MASQUERADE_save(const void *ip, const st | ||
|
||
if (r->flags & NF_NAT_RANGE_PROTO_RANDOM_FULLY) | ||
printf(" --random-fully"); | ||
+ | ||
+ if (r->min_ip == 1) | ||
+ printf(" --mode fullcone"); | ||
} | ||
|
||
static int MASQUERADE_xlate(struct xt_xlate *xl, |
Oops, something went wrong.