summaryrefslogtreecommitdiff
path: root/src/SocketCore.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-02-23 13:50:35 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-02-23 13:50:35 +0000
commitfa6fd758afc1dea263a43c3e21ed7b1b8ad0773c (patch)
treef241718f7a8dca7ec8e65daac39dbaf259a722ac /src/SocketCore.cc
parent232deb47b5af1c0a53c84da18c6cabe6637fcaa8 (diff)
2010-02-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added aiFlags argument to getInterfaceAddress(). Use AI_NUMERICHOST to find interface specified using --bt-lpd-interface option to avoid time-consuming address lookup. * src/BtSetup.cc * src/SocketCore.cc * src/SocketCore.h
Diffstat (limited to 'src/SocketCore.cc')
-rw-r--r--src/SocketCore.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index 68cfd33f..3857922d 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -1267,7 +1267,7 @@ void SocketCore::bindAddress(const std::string& iface)
void getInterfaceAddress
(std::vector<std::pair<struct sockaddr_storage, socklen_t> >& ifAddrs,
- const std::string& iface, int family)
+ const std::string& iface, int family, int aiFlags)
{
Logger* logger = LogFactory::getInstance();
if(logger->debug()) {
@@ -1314,11 +1314,9 @@ void getInterfaceAddress
if(ifAddrs.empty()) {
struct addrinfo* res;
int s;
- s = callGetaddrinfo(&res, iface.c_str(), 0, family,
- SOCK_STREAM, 0, 0);
+ s = callGetaddrinfo(&res, iface.c_str(), 0, family, SOCK_STREAM, aiFlags,0);
if(s) {
- logger->info(MSG_INTERFACE_NOT_FOUND,
- iface.c_str(), gai_strerror(s));
+ logger->info(MSG_INTERFACE_NOT_FOUND, iface.c_str(), gai_strerror(s));
} else {
WSAAPI_AUTO_DELETE<struct addrinfo*> resDeleter(res, freeaddrinfo);
struct addrinfo* rp;