summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/tuntap_pdu_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/lib/tuntap_pdu_impl.cc')
-rw-r--r--gr-blocks/lib/tuntap_pdu_impl.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/gr-blocks/lib/tuntap_pdu_impl.cc b/gr-blocks/lib/tuntap_pdu_impl.cc
index 83e861ff94..e5e7569077 100644
--- a/gr-blocks/lib/tuntap_pdu_impl.cc
+++ b/gr-blocks/lib/tuntap_pdu_impl.cc
@@ -63,12 +63,14 @@ tuntap_pdu_impl::tuntap_pdu_impl(std::string dev, int MTU, bool istunflag)
"gr::tuntap_pdu::make: tun_alloc failed (are you running as root?)");
int err = set_mtu(dev_cstr, MTU);
- if (err < 0)
- std::cerr << boost::format("gr::tuntap_pdu: failed to set MTU to %d.\n"
- "You should use ifconfig to set the MTU. E.g.,\n"
- " $ sudo ifconfig %s mtu %d\n") %
- MTU % dev % MTU
- << std::endl;
+ if (err < 0) {
+ std::ostringstream msg;
+ msg << boost::format("failed to set MTU to %d. You should use ifconfig to set "
+ "the MTU. E.g., `$ sudo ifconfig %s mtu %d`") %
+ MTU % dev % MTU;
+ GR_LOG_ERROR(d_logger, msg.str());
+ }
+
std::cout << boost::format("Allocated virtual ethernet interface: %s\n"
"You must now use ifconfig to set its IP address. E.g.,\n"