summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/ethertap.cc3
-rw-r--r--src/dev/terminal.cc5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/dev/ethertap.cc b/src/dev/ethertap.cc
index 81b84d179..c7b292c8a 100644
--- a/src/dev/ethertap.cc
+++ b/src/dev/ethertap.cc
@@ -130,6 +130,9 @@ EtherTap::EtherTap(const Params *p)
: EtherObject(p), event(NULL), socket(-1), buflen(p->bufsz), dump(p->dump),
interface(NULL), txEvent(this)
{
+ if (ListenSocket::allDisabled())
+ fatal("All listeners are disabled! EtherTap can't work!");
+
buffer = new char[buflen];
listener = new TapListener(this, p->port);
listener->listen();
diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc
index 47f280ad3..58371a2bd 100644
--- a/src/dev/terminal.cc
+++ b/src/dev/terminal.cc
@@ -125,6 +125,11 @@ Terminal::~Terminal()
void
Terminal::listen(int port)
{
+ if (ListenSocket::allDisabled()) {
+ warn_once("Sockets disabled, not accepting terminal connections");
+ return;
+ }
+
while (!listener.listen(port, true)) {
DPRINTF(Terminal,
": can't bind address terminal port %d inuse PID %d\n",