From 5f5302e59535c988188e3857469c5414014d62c4 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 25 Jan 2018 17:27:08 -0500 Subject: More useful to allow arrays of IPs to bind to. --- service/OneService.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'service/OneService.cpp') diff --git a/service/OneService.cpp b/service/OneService.cpp index a9a8171c..bcdef04f 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -565,7 +565,7 @@ public: } // Read local configuration - bool bindToWildcard = false; + std::vector explicitBind; { std::map ppc; @@ -635,7 +635,17 @@ public: _controllerDbPath = cdbp; // Bind to wildcard instead of to specific interfaces (disables full tunnel capability) - bindToWildcard = OSUtils::jsonBool(settings["bindToWildcard"],false); + json &bind = settings["bind"]; + if (bind.is_array()) { + for(unsigned long i=0;i 0) { + InetAddress ip(ips.c_str()); + if ((ip.ss_family == AF_INET)||(ip.ss_family == AF_INET6)) + explicitBind.push_back(ip); + } + } + } } // Set trusted paths if there are any @@ -805,7 +815,7 @@ public: if (_ports[i]) p[pc++] = _ports[i]; } - _binder.refresh(_phy,p,pc,bindToWildcard,*this); + _binder.refresh(_phy,p,pc,explicitBind,*this); { Mutex::Lock _l(_nets_m); for(std::map::iterator n(_nets.begin());n!=_nets.end();++n) { -- cgit v1.2.3