mirror of
https://github.com/openwrt/packages.git
synced 2025-12-21 21:24:31 +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")) {
|
||||
|
||||
@@ -31,7 +31,7 @@ extern "C" { //TODO(pst): remove when in upstream
|
||||
// std::cout<<std::endl;
|
||||
|
||||
// // example for exploring:
|
||||
// ubus::strings keys{"ipv4-address", "", "*"};
|
||||
// ubus::strings keys{"ipv4-address", "", ""};
|
||||
// for (auto x : ubus::call("network.interface.lan", "status").filter(keys)) {
|
||||
// std::cout<<blobmsg_name(x)<<": ";
|
||||
// switch (blob_id(x)) {
|
||||
@@ -173,8 +173,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
|
||||
explicit iterator(const blob_attr * msg, const strings & filter)
|
||||
explicit iterator(const blob_attr * msg, const strings & filter={""})
|
||||
: keys{filter}, n{keys.size()-1}, pos{msg}, cur{this}
|
||||
{
|
||||
if (pos!=nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user