diff --git a/osdep/Binder.hpp b/osdep/Binder.hpp index bd515eaab..d321d3955 100644 --- a/osdep/Binder.hpp +++ b/osdep/Binder.hpp @@ -377,8 +377,13 @@ class Binder { #endif } else { - for (std::vector::const_iterator i(explicitBind.begin()); i != explicitBind.end(); ++i) - localIfAddrs.insert(std::pair(*i, std::string())); + for (std::vector::const_iterator i(explicitBind.begin()); i != explicitBind.end(); ++i) { + InetAddress ip = InetAddress(*i); + for (int x = 0; x < (int)portCount; ++x) { + ip.setPort(ports[x]); + localIfAddrs.insert(std::pair(ip, std::string())); + } + } } // Default to binding to wildcard if we can't enumerate addresses