From 928e17324ee19aa09bea1c6b441b20a9f3049c83 Mon Sep 17 00:00:00 2001 From: sbwml Date: Wed, 17 Jul 2024 01:52:05 +0800 Subject: [PATCH 1/3] config-common: include kmod-usb-storage-uas to support for USB Attached SCSI * fix #42 Signed-off-by: sbwml --- openwrt/23-config-common | 1 + openwrt/23-config-minimal-common | 1 + 2 files changed, 2 insertions(+) diff --git a/openwrt/23-config-common b/openwrt/23-config-common index 1b4f0e9bd..beb2db3d4 100644 --- a/openwrt/23-config-common +++ b/openwrt/23-config-common @@ -210,6 +210,7 @@ CONFIG_PACKAGE_kmod-tcp-brutal=y CONFIG_PACKAGE_kmod-tls=y CONFIG_PACKAGE_kmod-tun=y CONFIG_PACKAGE_kmod-usb-audio=y +CONFIG_PACKAGE_kmod-usb-storage-uas=y CONFIG_PACKAGE_kmod-usb2-pci=y CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb3=y diff --git a/openwrt/23-config-minimal-common b/openwrt/23-config-minimal-common index 26c8599e7..fc3ec9971 100644 --- a/openwrt/23-config-minimal-common +++ b/openwrt/23-config-minimal-common @@ -121,6 +121,7 @@ CONFIG_PACKAGE_kmod-tcp-brutal=y CONFIG_PACKAGE_kmod-tls=y CONFIG_PACKAGE_kmod-tun=y CONFIG_PACKAGE_kmod-usb-audio=y +CONFIG_PACKAGE_kmod-usb-storage-uas=y CONFIG_PACKAGE_kmod-usb2-pci=y CONFIG_PACKAGE_kmod-usb2=y CONFIG_PACKAGE_kmod-usb3=y From 517bb77b24f74b7eca9c5b8773900aad54053646 Mon Sep 17 00:00:00 2001 From: sbwml Date: Wed, 17 Jul 2024 03:50:34 +0800 Subject: [PATCH 2/3] miniupnpd: Update to 2.3.6 * Merge patch: 03-Update-301-options-force_forwarding-support.patch.patch Signed-off-by: sbwml --- .../patch/miniupnpd/02-force_forwarding.patch | 82 +++----- ...tions-force_forwarding-support.patch.patch | 189 ------------------ openwrt/scripts/00-prepare_base.sh | 3 +- 3 files changed, 30 insertions(+), 244 deletions(-) delete mode 100644 openwrt/patch/miniupnpd/03-Update-301-options-force_forwarding-support.patch.patch diff --git a/openwrt/patch/miniupnpd/02-force_forwarding.patch b/openwrt/patch/miniupnpd/02-force_forwarding.patch index 579379383..bb414b2cd 100644 --- a/openwrt/patch/miniupnpd/02-force_forwarding.patch +++ b/openwrt/patch/miniupnpd/02-force_forwarding.patch @@ -66,10 +66,10 @@ index bd7c3ec..b03d60a 100644 option download 1024 diff --git a/net/miniupnpd/patches/301-options-force_forwarding-support.patch b/net/miniupnpd/patches/301-options-force_forwarding-support.patch new file mode 100644 -index 0000000..927dad1 +index 000000000..ecd4b34c4 --- /dev/null +++ b/net/miniupnpd/patches/301-options-force_forwarding-support.patch -@@ -0,0 +1,209 @@ +@@ -0,0 +1,185 @@ +From 09690d550a1ad3cc3a8cba79aa2e970c3b2b8fbe Mon Sep 17 00:00:00 2001 +From: Chen Minqiang +Date: Sun, 5 Jul 2020 10:42:52 +0800 @@ -93,20 +93,18 @@ index 0000000..927dad1 + upnpsoap.c | 6 +++++- + 11 files changed, 26 insertions(+), 8 deletions(-) + -+diff --git a/miniupnpd.c b/miniupnpd.c -+index f13dd8d..21ce4d3 100644 +--- a/miniupnpd.c ++++ b/miniupnpd.c -+@@ -1009,7 +1009,7 @@ parselanaddr(struct lan_addr_s * lan_addr, const char * str) -+ fprintf(stderr, "Error parsing address : %s\n", lan_addr->ext_ip_str); ++@@ -1010,7 +1010,7 @@ parselanaddr(struct lan_addr_s * lan_add ++ INIT_PRINT_ERR("Error parsing address : %s\n", lan_addr->ext_ip_str); + return -1; + } +- if(addr_is_reserved(&lan_addr->ext_ip_addr)) { ++ if(addr_is_reserved(&lan_addr->ext_ip_addr) && !GETFLAG(FORCEFORWARDINGMASK)) { + /* error */ -+ fprintf(stderr, "Error: option ext_ip address contains reserved / private address : %s\n", lan_addr->ext_ip_str); ++ INIT_PRINT_ERR("Error: option ext_ip address contains reserved / private address : %s\n", lan_addr->ext_ip_str); + return -1; -+@@ -1241,6 +1241,10 @@ init(int argc, char * * argv, struct runtime_vars * v) ++@@ -1252,6 +1252,10 @@ init(int argc, char * * argv, struct run + case UPNPEXT_IP: + use_ext_ip_addr = ary_options[i].value; + break; @@ -117,51 +115,48 @@ index 0000000..927dad1 + case UPNPEXT_PERFORM_STUN: + if(strcmp(ary_options[i].value, "yes") == 0) + SETFLAG(PERFORMSTUNMASK); -+@@ -1779,7 +1783,7 @@ init(int argc, char * * argv, struct runtime_vars * v) -+ fprintf(stderr, "Error: option ext_ip contains invalid address %s\n", use_ext_ip_addr); ++@@ -1859,7 +1863,7 @@ init(int argc, char * * argv, struct run ++ INIT_PRINT_ERR("Error: option ext_ip contains invalid address %s\n", use_ext_ip_addr); + return 1; + } +- if (addr_is_reserved(&addr)) { ++ if (addr_is_reserved(&addr) && !GETFLAG(FORCEFORWARDINGMASK)) { -+ fprintf(stderr, "Error: option ext_ip contains reserved / private address %s, not public routable\n", use_ext_ip_addr); ++ INIT_PRINT_ERR("Error: option ext_ip contains reserved / private address %s, not public routable\n", use_ext_ip_addr); + return 1; + } -+@@ -2190,7 +2194,7 @@ main(int argc, char * * argv) -+ struct in_addr addr; ++@@ -2305,7 +2309,7 @@ main(int argc, char * * argv) + if (getifaddr(ext_if_name, if_addr, INET_ADDRSTRLEN, &addr, NULL) < 0) { + syslog(LOG_WARNING, "Cannot get IP address for ext interface %s. Network is down", ext_if_name); ++ disable_port_forwarding = 1; +- } else if (addr_is_reserved(&addr)) { ++ } else if (addr_is_reserved(&addr) && !GETFLAG(FORCEFORWARDINGMASK)) { + syslog(LOG_INFO, "Reserved / private IP address %s on ext interface %s: Port forwarding is impossible", if_addr, ext_if_name); + syslog(LOG_INFO, "You are probably behind NAT, enable option ext_perform_stun=yes to detect public IP address"); + syslog(LOG_INFO, "Or use ext_ip= / -o option to declare public IP address"); -+@@ -2460,7 +2464,7 @@ main(int argc, char * * argv) -+ char if_addr[INET_ADDRSTRLEN]; -+ struct in_addr addr; -+ if (getifaddr(ext_if_name, if_addr, INET_ADDRSTRLEN, &addr, NULL) == 0) { ++@@ -2596,7 +2600,7 @@ main(int argc, char * * argv) ++ syslog(LOG_WARNING, "Cannot get IP address for ext interface %s. Network is down", ext_if_name); ++ disable_port_forwarding = 1; ++ } else { +- int reserved = addr_is_reserved(&addr); ++ int reserved = addr_is_reserved(&addr) && !GETFLAG(FORCEFORWARDINGMASK); -+ if (disable_port_forwarding && !reserved) { -+ syslog(LOG_INFO, "Public IP address %s on ext interface %s: Port forwarding is enabled", if_addr, ext_if_name); -+ } else if (!disable_port_forwarding && reserved) { -+diff --git a/miniupnpd.conf b/miniupnpd.conf -+index 6355532..68a1fda 100644 ++ if (!disable_port_forwarding && reserved) { ++ syslog(LOG_INFO, "Reserved / private IP address %s on ext interface %s: Port forwarding is impossible", if_addr, ext_if_name); ++ syslog(LOG_INFO, "You are probably behind NAT, enable option ext_perform_stun=yes to detect public IP address"); +--- a/miniupnpd.conf ++++ b/miniupnpd.conf -+@@ -9,6 +9,8 @@ -+ # Setting ext_ip is also useful in double NAT setup, you can declare here ++@@ -12,6 +12,9 @@ + # the public IP address. + #ext_ip= -++#force forwarding enable for upnp: default is no ++ +++# force forwarding enable for upnp: default is no ++#force_forwarding=yes +++ + # WAN interface must have public IP address. Otherwise it is behind NAT + # and port forwarding is impossible. In some cases WAN interface can be + # behind unrestricted full-cone NAT 1:1 when all incoming traffic is NAT-ed and -+diff --git a/natpmp.c b/natpmp.c -+index 14690a6..e3acce1 100644 +--- a/natpmp.c ++++ b/natpmp.c -+@@ -108,7 +108,7 @@ static void FillPublicAddressResponse(unsigned char * resp, in_addr_t senderaddr ++@@ -109,7 +109,7 @@ static void FillPublicAddressResponse(un + syslog(LOG_ERR, "Failed to get IP for interface %s", ext_if_name); + resp[3] = 3; /* Network Failure (e.g. NAT box itself + * has not obtained a DHCP lease) */ @@ -170,11 +165,9 @@ index 0000000..927dad1 + resp[3] = 3; /* Network Failure, box has not obtained + public IP address */ + } else { -+diff --git a/options.c b/options.c -+index 05fa317..9ff0502 100644 +--- a/options.c ++++ b/options.c -+@@ -34,6 +34,7 @@ static const struct { ++@@ -35,6 +35,7 @@ static const struct { + { UPNPEXT_IFNAME6, "ext_ifname6" }, + #endif + { UPNPEXT_IP, "ext_ip" }, @@ -182,8 +175,6 @@ index 0000000..927dad1 + { UPNPEXT_PERFORM_STUN, "ext_perform_stun" }, + { UPNPEXT_STUN_HOST, "ext_stun_host" }, + { UPNPEXT_STUN_PORT, "ext_stun_port" }, -+diff --git a/options.h b/options.h -+index 96cdbbf..f9cf201 100644 +--- a/options.h ++++ b/options.h +@@ -21,6 +21,7 @@ enum upnpconfigoptions { @@ -194,8 +185,6 @@ index 0000000..927dad1 + UPNPEXT_PERFORM_STUN, /* ext_perform_stun */ + UPNPEXT_STUN_HOST, /* ext_stun_host */ + UPNPEXT_STUN_PORT, /* ext_stun_port */ -+diff --git a/testgetifaddr.c b/testgetifaddr.c -+index 8045b89..b5cdbb4 100644 +--- a/testgetifaddr.c ++++ b/testgetifaddr.c +@@ -13,6 +13,8 @@ @@ -207,8 +196,6 @@ index 0000000..927dad1 + #if defined(__sun) + /* solaris 10 does not define LOG_PERROR */ + #define LOG_PERROR 0 -+diff --git a/testportinuse.c b/testportinuse.c -+index 98574c6..507f830 100644 +--- a/testportinuse.c ++++ b/testportinuse.c +@@ -14,6 +14,8 @@ @@ -220,11 +207,9 @@ index 0000000..927dad1 + int main(int argc, char * * argv) + { + #ifndef CHECK_PORTINUSE -+diff --git a/upnpdescgen.c b/upnpdescgen.c -+index 46110f2..3a86c09 100644 +--- a/upnpdescgen.c ++++ b/upnpdescgen.c -+@@ -1290,7 +1290,7 @@ genEventVars(int * len, const struct serviceDesc * s) ++@@ -1316,7 +1316,7 @@ genEventVars(int * len, const struct ser + else { + struct in_addr addr; + char ext_ip_addr[INET_ADDRSTRLEN]; @@ -233,11 +218,9 @@ index 0000000..927dad1 + str = strcat_str(str, len, &tmplen, "0.0.0.0"); + } else { + str = strcat_str(str, len, &tmplen, ext_ip_addr); -+diff --git a/upnpglobalvars.h b/upnpglobalvars.h -+index a474353..a36f515 100644 +--- a/upnpglobalvars.h ++++ b/upnpglobalvars.h -+@@ -84,6 +84,8 @@ extern int runtime_flags; ++@@ -87,6 +87,8 @@ extern int runtime_flags; + + #define PERFORMSTUNMASK 0x1000 + @@ -246,11 +229,9 @@ index 0000000..927dad1 + #define SETFLAG(mask) runtime_flags |= mask + #define GETFLAG(mask) (runtime_flags & mask) + #define CLEARFLAG(mask) runtime_flags &= ~mask -+diff --git a/upnpredirect.c b/upnpredirect.c -+index 07fa229..c9fc7ac 100644 +--- a/upnpredirect.c ++++ b/upnpredirect.c -+@@ -444,7 +444,7 @@ upnp_redirect_internal(const char * rhost, unsigned short eport, ++@@ -444,7 +444,7 @@ upnp_redirect_internal(const char * rhos + { + /*syslog(LOG_INFO, "redirecting port %hu to %s:%hu protocol %s for: %s", + eport, iaddr, iport, protocol, desc); */ @@ -259,11 +240,9 @@ index 0000000..927dad1 + return -1; + if(add_redirect_rule2(ext_if_name, rhost, eport, iaddr, iport, proto, + desc, timestamp) < 0) { -+diff --git a/upnpsoap.c b/upnpsoap.c -+index fb4b70e..932df62 100644 +--- a/upnpsoap.c ++++ b/upnpsoap.c -+@@ -348,7 +348,11 @@ GetExternalIPAddress(struct upnphttp * h, const char * action, const char * ns) ++@@ -348,7 +348,11 @@ GetExternalIPAddress(struct upnphttp * h + ext_ip_addr[0] = '\0'; + } else if (addr_is_reserved(&addr)) { + syslog(LOG_NOTICE, "private/reserved address %s is not suitable for external IP", ext_ip_addr); @@ -276,9 +255,6 @@ index 0000000..927dad1 + } + } + #else -+-- -+2.17.1 -+ -- -2.34.8 +2.39.3 diff --git a/openwrt/patch/miniupnpd/03-Update-301-options-force_forwarding-support.patch.patch b/openwrt/patch/miniupnpd/03-Update-301-options-force_forwarding-support.patch.patch deleted file mode 100644 index 5e9c94ced..000000000 --- a/openwrt/patch/miniupnpd/03-Update-301-options-force_forwarding-support.patch.patch +++ /dev/null @@ -1,189 +0,0 @@ -diff --git a/net/miniupnpd/patches/301-options-force_forwarding-support.patch b/net/miniupnpd/patches/301-options-force_forwarding-support.patch -index 927dad1..0eb9d6b 100644 ---- a/net/miniupnpd/patches/301-options-force_forwarding-support.patch -+++ b/net/miniupnpd/patches/301-options-force_forwarding-support.patch -@@ -21,20 +21,18 @@ Signed-off-by: Chen Minqiang - upnpsoap.c | 6 +++++- - 11 files changed, 26 insertions(+), 8 deletions(-) - --diff --git a/miniupnpd.c b/miniupnpd.c --index f13dd8d..21ce4d3 100644 - --- a/miniupnpd.c - +++ b/miniupnpd.c --@@ -1009,7 +1009,7 @@ parselanaddr(struct lan_addr_s * lan_addr, const char * str) -- fprintf(stderr, "Error parsing address : %s\n", lan_addr->ext_ip_str); -+@@ -1014,7 +1014,7 @@ parselanaddr(struct lan_addr_s * lan_add -+ INIT_PRINT_ERR("Error parsing address : %s\n", lan_addr->ext_ip_str); - return -1; - } - - if(addr_is_reserved(&lan_addr->ext_ip_addr)) { - + if(addr_is_reserved(&lan_addr->ext_ip_addr) && !GETFLAG(FORCEFORWARDINGMASK)) { - /* error */ -- fprintf(stderr, "Error: option ext_ip address contains reserved / private address : %s\n", lan_addr->ext_ip_str); -+ INIT_PRINT_ERR("Error: option ext_ip address contains reserved / private address : %s\n", lan_addr->ext_ip_str); - return -1; --@@ -1241,6 +1241,10 @@ init(int argc, char * * argv, struct runtime_vars * v) -+@@ -1256,6 +1256,10 @@ init(int argc, char * * argv, struct run - case UPNPEXT_IP: - use_ext_ip_addr = ary_options[i].value; - break; -@@ -45,35 +43,33 @@ index f13dd8d..21ce4d3 100644 - case UPNPEXT_PERFORM_STUN: - if(strcmp(ary_options[i].value, "yes") == 0) - SETFLAG(PERFORMSTUNMASK); --@@ -1779,7 +1783,7 @@ init(int argc, char * * argv, struct runtime_vars * v) -- fprintf(stderr, "Error: option ext_ip contains invalid address %s\n", use_ext_ip_addr); -+@@ -1851,7 +1855,7 @@ init(int argc, char * * argv, struct run -+ INIT_PRINT_ERR("Error: option ext_ip contains invalid address %s\n", use_ext_ip_addr); - return 1; - } - - if (addr_is_reserved(&addr)) { - + if (addr_is_reserved(&addr) && !GETFLAG(FORCEFORWARDINGMASK)) { -- fprintf(stderr, "Error: option ext_ip contains reserved / private address %s, not public routable\n", use_ext_ip_addr); -+ INIT_PRINT_ERR("Error: option ext_ip contains reserved / private address %s, not public routable\n", use_ext_ip_addr); - return 1; - } --@@ -2190,7 +2194,7 @@ main(int argc, char * * argv) -- struct in_addr addr; -+@@ -2258,7 +2262,7 @@ main(int argc, char * * argv) - if (getifaddr(ext_if_name, if_addr, INET_ADDRSTRLEN, &addr, NULL) < 0) { - syslog(LOG_WARNING, "Cannot get IP address for ext interface %s. Network is down", ext_if_name); -+ disable_port_forwarding = 1; - - } else if (addr_is_reserved(&addr)) { - + } else if (addr_is_reserved(&addr) && !GETFLAG(FORCEFORWARDINGMASK)) { - syslog(LOG_INFO, "Reserved / private IP address %s on ext interface %s: Port forwarding is impossible", if_addr, ext_if_name); - syslog(LOG_INFO, "You are probably behind NAT, enable option ext_perform_stun=yes to detect public IP address"); - syslog(LOG_INFO, "Or use ext_ip= / -o option to declare public IP address"); --@@ -2460,7 +2464,7 @@ main(int argc, char * * argv) -- char if_addr[INET_ADDRSTRLEN]; -- struct in_addr addr; -- if (getifaddr(ext_if_name, if_addr, INET_ADDRSTRLEN, &addr, NULL) == 0) { -+@@ -2549,7 +2553,7 @@ main(int argc, char * * argv) -+ syslog(LOG_WARNING, "Cannot get IP address for ext interface %s. Network is down", ext_if_name); -+ disable_port_forwarding = 1; -+ } else { - - int reserved = addr_is_reserved(&addr); - + int reserved = addr_is_reserved(&addr) && !GETFLAG(FORCEFORWARDINGMASK); -- if (disable_port_forwarding && !reserved) { -- syslog(LOG_INFO, "Public IP address %s on ext interface %s: Port forwarding is enabled", if_addr, ext_if_name); -- } else if (!disable_port_forwarding && reserved) { --diff --git a/miniupnpd.conf b/miniupnpd.conf --index 6355532..68a1fda 100644 -+ if (!disable_port_forwarding && reserved) { -+ syslog(LOG_INFO, "Reserved / private IP address %s on ext interface %s: Port forwarding is impossible", if_addr, ext_if_name); -+ syslog(LOG_INFO, "You are probably behind NAT, enable option ext_perform_stun=yes to detect public IP address"); - --- a/miniupnpd.conf - +++ b/miniupnpd.conf - @@ -9,6 +9,8 @@ -@@ -85,11 +81,9 @@ index 6355532..68a1fda 100644 - # WAN interface must have public IP address. Otherwise it is behind NAT - # and port forwarding is impossible. In some cases WAN interface can be - # behind unrestricted full-cone NAT 1:1 when all incoming traffic is NAT-ed and --diff --git a/natpmp.c b/natpmp.c --index 14690a6..e3acce1 100644 - --- a/natpmp.c - +++ b/natpmp.c --@@ -108,7 +108,7 @@ static void FillPublicAddressResponse(unsigned char * resp, in_addr_t senderaddr -+@@ -108,7 +108,7 @@ static void FillPublicAddressResponse(un - syslog(LOG_ERR, "Failed to get IP for interface %s", ext_if_name); - resp[3] = 3; /* Network Failure (e.g. NAT box itself - * has not obtained a DHCP lease) */ -@@ -98,11 +92,9 @@ index 14690a6..e3acce1 100644 - resp[3] = 3; /* Network Failure, box has not obtained - public IP address */ - } else { --diff --git a/options.c b/options.c --index 05fa317..9ff0502 100644 - --- a/options.c - +++ b/options.c --@@ -34,6 +34,7 @@ static const struct { -+@@ -35,6 +35,7 @@ static const struct { - { UPNPEXT_IFNAME6, "ext_ifname6" }, - #endif - { UPNPEXT_IP, "ext_ip" }, -@@ -110,8 +102,6 @@ index 05fa317..9ff0502 100644 - { UPNPEXT_PERFORM_STUN, "ext_perform_stun" }, - { UPNPEXT_STUN_HOST, "ext_stun_host" }, - { UPNPEXT_STUN_PORT, "ext_stun_port" }, --diff --git a/options.h b/options.h --index 96cdbbf..f9cf201 100644 - --- a/options.h - +++ b/options.h - @@ -21,6 +21,7 @@ enum upnpconfigoptions { -@@ -122,8 +112,6 @@ index 96cdbbf..f9cf201 100644 - UPNPEXT_PERFORM_STUN, /* ext_perform_stun */ - UPNPEXT_STUN_HOST, /* ext_stun_host */ - UPNPEXT_STUN_PORT, /* ext_stun_port */ --diff --git a/testgetifaddr.c b/testgetifaddr.c --index 8045b89..b5cdbb4 100644 - --- a/testgetifaddr.c - +++ b/testgetifaddr.c - @@ -13,6 +13,8 @@ -@@ -135,8 +123,6 @@ index 8045b89..b5cdbb4 100644 - #if defined(__sun) - /* solaris 10 does not define LOG_PERROR */ - #define LOG_PERROR 0 --diff --git a/testportinuse.c b/testportinuse.c --index 98574c6..507f830 100644 - --- a/testportinuse.c - +++ b/testportinuse.c - @@ -14,6 +14,8 @@ -@@ -148,11 +134,9 @@ index 98574c6..507f830 100644 - int main(int argc, char * * argv) - { - #ifndef CHECK_PORTINUSE --diff --git a/upnpdescgen.c b/upnpdescgen.c --index 46110f2..3a86c09 100644 - --- a/upnpdescgen.c - +++ b/upnpdescgen.c --@@ -1290,7 +1290,7 @@ genEventVars(int * len, const struct serviceDesc * s) -+@@ -1305,7 +1305,7 @@ genEventVars(int * len, const struct ser - else { - struct in_addr addr; - char ext_ip_addr[INET_ADDRSTRLEN]; -@@ -161,11 +145,9 @@ index 46110f2..3a86c09 100644 - str = strcat_str(str, len, &tmplen, "0.0.0.0"); - } else { - str = strcat_str(str, len, &tmplen, ext_ip_addr); --diff --git a/upnpglobalvars.h b/upnpglobalvars.h --index a474353..a36f515 100644 - --- a/upnpglobalvars.h - +++ b/upnpglobalvars.h --@@ -84,6 +84,8 @@ extern int runtime_flags; -+@@ -87,6 +87,8 @@ extern int runtime_flags; - - #define PERFORMSTUNMASK 0x1000 - -@@ -174,11 +156,9 @@ index a474353..a36f515 100644 - #define SETFLAG(mask) runtime_flags |= mask - #define GETFLAG(mask) (runtime_flags & mask) - #define CLEARFLAG(mask) runtime_flags &= ~mask --diff --git a/upnpredirect.c b/upnpredirect.c --index 07fa229..c9fc7ac 100644 - --- a/upnpredirect.c - +++ b/upnpredirect.c --@@ -444,7 +444,7 @@ upnp_redirect_internal(const char * rhost, unsigned short eport, -+@@ -444,7 +444,7 @@ upnp_redirect_internal(const char * rhos - { - /*syslog(LOG_INFO, "redirecting port %hu to %s:%hu protocol %s for: %s", - eport, iaddr, iport, protocol, desc); */ -@@ -187,11 +167,9 @@ index 07fa229..c9fc7ac 100644 - return -1; - if(add_redirect_rule2(ext_if_name, rhost, eport, iaddr, iport, proto, - desc, timestamp) < 0) { --diff --git a/upnpsoap.c b/upnpsoap.c --index fb4b70e..932df62 100644 - --- a/upnpsoap.c - +++ b/upnpsoap.c --@@ -348,7 +348,11 @@ GetExternalIPAddress(struct upnphttp * h, const char * action, const char * ns) -+@@ -348,7 +348,11 @@ GetExternalIPAddress(struct upnphttp * h - ext_ip_addr[0] = '\0'; - } else if (addr_is_reserved(&addr)) { - syslog(LOG_NOTICE, "private/reserved address %s is not suitable for external IP", ext_ip_addr); -@@ -204,6 +182,3 @@ index fb4b70e..932df62 100644 - } - } - #else ---- --2.17.1 -- diff --git a/openwrt/scripts/00-prepare_base.sh b/openwrt/scripts/00-prepare_base.sh index 594f7fbde..cc6eb86fe 100644 --- a/openwrt/scripts/00-prepare_base.sh +++ b/openwrt/scripts/00-prepare_base.sh @@ -326,13 +326,12 @@ sed -i 's/procd_set_param stderr 1/procd_set_param stderr 0/g' feeds/packages/ut # UPnP rm -rf feeds/packages/net/miniupnpd -git clone https://$gitea/sbwml/miniupnpd feeds/packages/net/miniupnpd +git clone https://$gitea/sbwml/miniupnpd feeds/packages/net/miniupnpd -b v2.3.6 rm -rf feeds/luci/applications/luci-app-upnp git clone https://$gitea/sbwml/luci-app-upnp feeds/luci/applications/luci-app-upnp pushd feeds/packages curl -s https://$mirror/openwrt/patch/miniupnpd/01-set-presentation_url.patch | patch -p1 curl -s https://$mirror/openwrt/patch/miniupnpd/02-force_forwarding.patch | patch -p1 - curl -s https://$mirror/openwrt/patch/miniupnpd/03-Update-301-options-force_forwarding-support.patch.patch | patch -p1 curl -s https://$mirror/openwrt/patch/miniupnpd/04-enable-force_forwarding-by-default.patch | patch -p1 popd From 9d110c5bd008746db51fffda02592140f80ad1fd Mon Sep 17 00:00:00 2001 From: sbwml Date: Wed, 17 Jul 2024 04:00:30 +0800 Subject: [PATCH 3/3] miniupnpd: set `presentation_url` by uci Signed-off-by: sbwml --- openwrt/patch/miniupnpd/01-set-presentation_url.patch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openwrt/patch/miniupnpd/01-set-presentation_url.patch b/openwrt/patch/miniupnpd/01-set-presentation_url.patch index 21c391459..c7111295a 100644 --- a/openwrt/patch/miniupnpd/01-set-presentation_url.patch +++ b/openwrt/patch/miniupnpd/01-set-presentation_url.patch @@ -1,13 +1,12 @@ diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init -index de35045..c5a14ab 100644 +index de3504529..e89e4e55a 100644 --- a/net/miniupnpd/files/miniupnpd.init +++ b/net/miniupnpd/files/miniupnpd.init -@@ -217,6 +217,9 @@ stop_service() { +@@ -217,6 +217,8 @@ stop_service() { } start_service() { -+ sed -i '/presentation_url/d' /etc/config/upnpd -+ sed -i "\/uuid/a\\\toption presentation_url 'http://$(uci -q get network.lan.ipaddr)/'" /etc/config/upnpd ++ uci set upnpd.config.presentation_url="http://$(uci -q get network.lan.ipaddr)/" + uci commit upnpd config_load "upnpd" config_foreach upnpd "upnpd"