From 78c3a83c878290d9dc990ec79f876a29b7e657fd Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 17 Jun 2008 22:50:37 +0000 Subject: [PATCH] Added an error message for when the user specifies a device(-e) that doesnt have a route to the target IP in windows. This was caught by another error message later on, but it was ambiguous and unrelated to the actual problem. --- targets.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/targets.cc b/targets.cc index 0768da682..91cde9547 100644 --- a/targets.cc +++ b/targets.cc @@ -521,6 +521,11 @@ do { if (rnfo.direct_connect) { hs->hostbatch[hidx]->setDirectlyConnected(true); } else { + //if the user selected an interface with the -e command that has no route to their target + //this error message will catch it. + if(rnfo.nexthop.ss_family!=AF_INET || rnfo.nexthop.ss_family!=AF_INET6 ){ + fatal("%s: can not find route for non-directly conected device %s.", __func__, hs->hostbatch[hidx]->NameIP()); + } hs->hostbatch[hidx]->setDirectlyConnected(false); hs->hostbatch[hidx]->setNextHop(&rnfo.nexthop, sizeof(rnfo.nexthop));