summaryrefslogtreecommitdiff
path: root/src/dev/ethertap.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-08-03 18:19:55 -0700
committerNathan Binkert <nate@binkert.org>2008-08-03 18:19:55 -0700
commit50ef39af82413ef463609f24173b22af13fad268 (patch)
tree44fb10aeaf17c5055c2ae315f5bc52e25180a3d3 /src/dev/ethertap.cc
parentede89c2d541051c2ed647e2967712e10b3c0fab0 (diff)
downloadgem5-50ef39af82413ef463609f24173b22af13fad268.tar.xz
sockets: Add a function to disable all listening sockets.
When invoking several copies of m5 on the same machine at the same time, there can be a race for TCP ports for the terminal connections or remote gdb. Expose a function to disable those ports, and have the regression scripts disable them. There are some SimObjects that have no other function than to be used with ports (NativeTrace and EtherTap), so they will panic if the ports are disabled.
Diffstat (limited to 'src/dev/ethertap.cc')
-rw-r--r--src/dev/ethertap.cc3
1 files changed, 3 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();