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:
Peter Stadler
2020-01-22 10:00:39 +01:00
parent 5cd9d62f52
commit f76f1e082d
3 changed files with 17 additions and 10 deletions

View File

@@ -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")) {