diff --git a/src/iface.cc b/src/iface.cc index 00a7c0f..3af0c88 100644 --- a/src/iface.cc +++ b/src/iface.cc @@ -564,7 +564,7 @@ void iface::handle_reverse_advert(const address& saddr, const std::string& ifnam for (std::list >::iterator it = parent->rules_begin(); it != parent->rules_end(); it++) { ptr ru = *it; - if (ru->addr() == saddr && + if (ru->addr() == saddr && ru->daughter() && ru->daughter()->name() == ifname) { logger::debug() << " - generating artifical advertisement: " << ifname; @@ -664,7 +664,7 @@ int iface::poll_all() if (is_pfd) { size = ifa->read_solicit(saddr, daddr, taddr); if (size < 0) { - logger::error() << "Failed to read from interface '%s'", ifa->_name.c_str(); + logger::error() << "Failed to read from interface '" << ifa->_name.c_str() << "'"; continue; } if (size == 0) { @@ -703,7 +703,7 @@ int iface::poll_all() } else { size = ifa->read_advert(saddr, taddr); if (size < 0) { - logger::error() << "Failed to read from interface '%s'", ifa->_name.c_str(); + logger::error() << "Failed to read from interface '" << ifa->_name.c_str() << "'"; continue; } if (size == 0) { diff --git a/src/session.cc b/src/session.cc index 4a2465c..b1e1ef1 100644 --- a/src/session.cc +++ b/src/session.cc @@ -209,7 +209,11 @@ void session::handle_auto_wire(const address& saddr, const std::string& ifname, logger::debug() << "session::system(" << route_cmd.str() << ")"; - system(route_cmd.str().c_str()); + int ret = system(route_cmd.str().c_str()); + if (ret != 0) { + logger::error() + << "system(" << route_cmd.str().c_str() << ") failed, return " << ret; + } _wired_via = saddr; } @@ -233,7 +237,11 @@ void session::handle_auto_wire(const address& saddr, const std::string& ifname, logger::debug() << "session::system(" << route_cmd.str() << ")"; - system(route_cmd.str().c_str()); + int ret = system(route_cmd.str().c_str()); + if (ret != 0) { + logger::error() + << "system(" << route_cmd.str().c_str() << ") failed, return " << ret; + } } _wired = true; @@ -261,7 +269,11 @@ void session::handle_auto_unwire(const std::string& ifname) logger::debug() << "session::system(" << route_cmd.str() << ")"; - system(route_cmd.str().c_str()); + int ret = system(route_cmd.str().c_str()); + if (ret != 0) { + logger::error() + << "system(" << route_cmd.str().c_str() << ") failed, return " << ret; + } } if (_wired_via.is_empty() == false) { @@ -277,7 +289,11 @@ void session::handle_auto_unwire(const std::string& ifname) logger::debug() << "session::system(" << route_cmd.str() << ")"; - system(route_cmd.str().c_str()); + int ret = system(route_cmd.str().c_str()); + if (ret != 0) { + logger::error() + << "system(" << route_cmd.str().c_str() << ") failed, return " << ret; + } } _wired = false;