summaryrefslogtreecommitdiff
path: root/src/lbpathtest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lbpathtest.cc')
-rw-r--r--src/lbpathtest.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lbpathtest.cc b/src/lbpathtest.cc
index 93fe544..fd2e39b 100644
--- a/src/lbpathtest.cc
+++ b/src/lbpathtest.cc
@@ -189,6 +189,10 @@ LBPathTest::send(const string &iface, const string &target_addr, int packet_id)
int icmp_pktsize = 40;
char buffer[icmp_pktsize];
+ if (iface.empty() || target_addr.empty()) {
+ return;
+ }
+
// 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());