summaryrefslogtreecommitdiff
path: root/src/lbpathtest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lbpathtest.cc')
-rw-r--r--src/lbpathtest.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lbpathtest.cc b/src/lbpathtest.cc
index a8ffbce..df29921 100644
--- a/src/lbpathtest.cc
+++ b/src/lbpathtest.cc
@@ -195,7 +195,10 @@ LBPathTest::send(const string &iface, const string &target_addr, int packet_id)
}
// bind a socket to a device name (might not work on all systems):
- setsockopt(_send_sock, SOL_SOCKET, SO_BINDTODEVICE, iface.c_str(), iface.size());
+ if (setsockopt(_send_sock, SOL_SOCKET, SO_BINDTODEVICE, iface.c_str(), iface.size()) != 0) {
+ syslog(LOG_ERR, "wan_lb: failure to bind to interface: %s", iface.c_str());
+ return; //will allow the test to time out then
+ }
//convert target_addr to ip addr
struct hostent *h = gethostbyname(target_addr.c_str());