mirror of
https://github.com/openwrt/packages.git
synced 2025-12-23 05:54:33 +04:00
nginx-util: fix PROVIDES and issue #6905
nginx-ssl-util and nginx-ssl-util-nopcre are replacements for each other, but cannot replace nginx-util (instead conflict with it). The hard coded [::1] could lead to a nginx error if build without IPv6. So, get the loopback addresses dynamically. Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
This commit is contained in:
@@ -13,6 +13,7 @@ void create_lan_listen()
|
||||
std::string ssl_listen = listen;
|
||||
std::string ssl_listen_default = listen;
|
||||
|
||||
#ifndef NO_UBUS
|
||||
auto add_listen = [&listen, &listen_default
|
||||
#ifdef NGINX_OPENSSL
|
||||
,&ssl_listen, &ssl_listen_default
|
||||
@@ -31,10 +32,16 @@ void create_lan_listen()
|
||||
#endif
|
||||
};
|
||||
|
||||
add_listen("", "127.0.0.1", "");
|
||||
add_listen("[", "::1", "]");
|
||||
auto loopback_status = ubus::call("network.interface.loopback", "status");
|
||||
|
||||
for (auto ip : loopback_status.filter("ipv4-address", "", "address")) {
|
||||
add_listen("", static_cast<const char *>(blobmsg_data(ip)), "");
|
||||
}
|
||||
|
||||
for (auto ip : loopback_status.filter("ipv6-address", "", "address")) {
|
||||
add_listen("[", static_cast<const char *>(blobmsg_data(ip)), "]");
|
||||
}
|
||||
|
||||
#ifndef NO_UBUS
|
||||
auto lan_status = ubus::call("network.interface.lan", "status");
|
||||
|
||||
for (auto ip : lan_status.filter("ipv4-address", "", "address")) {
|
||||
|
||||
Reference in New Issue
Block a user