summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-07-13 10:28:28 +0100
committerPeter Powell <petpow@saberuk.com>2018-07-18 19:22:17 +0100
commitb7716ed57704b2b2bcc665a590aecc8f02de631d (patch)
tree43f1c62613f3aee5074009a3b8e4582dc65c3638 /src/modules/m_spanningtree
parent87e328a1fbfcacafc013ba580d31dd4123f1e7e2 (diff)
Initial support for listening on UNIX socket endpoints.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 0b311a0bd..8bc3bfd9c 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -203,7 +203,13 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y)
return;
}
- if (strchr(x->IPAddr.c_str(),':'))
+ if (x->IPAddr.find('/') != std::string::npos)
+ {
+ struct stat sb;
+ if (stat(x->IPAddr.c_str(), &sb) == -1 || !S_ISSOCK(sb.st_mode))
+ ipvalid = false;
+ }
+ if (x->IPAddr.find(':') != std::string::npos)
{
in6_addr n;
if (inet_pton(AF_INET6, x->IPAddr.c_str(), &n) < 1)