diff options
author | Gabe Black <gabeblack@google.com> | 2017-05-05 16:53:42 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2017-05-09 16:44:30 +0000 |
commit | 8b4536556086e82f8edb2cea3ee391c9c3f25f6f (patch) | |
tree | 4d5e40fb811008dd202fd71c23aef1136ff25837 /src/python/m5 | |
parent | 2d5296ce1974fe1b16ba62dda3f91dd25cc199e1 (diff) | |
download | gem5-8b4536556086e82f8edb2cea3ee391c9c3f25f6f.tar.xz |
misc: Add the --listener-loopback-only command line option.
This option invokes the Listener::loopbackOnly() static function which
will make the port listeners bind to the loopback device exclusively and
ignore connections on other devices. That prevents external agents like
port scanners from disrupting simulations with spurious connections.
Change-Id: I46b22165046792a6f970826c109bdbce7db25c84
Reviewed-on: https://gem5-review.googlesource.com/3082
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/python/m5')
-rw-r--r-- | src/python/m5/main.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/python/m5/main.py b/src/python/m5/main.py index b987af4c8..49314303b 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -85,6 +85,9 @@ def parse_options(): choices=listener_modes, default="auto", help="Port (e.g., gdb) listener mode (auto: Enable if running " \ "interactively) [Default: %default]") + option("--listener-loopback-only", action="store_true", default=False, + help="Port listeners will only accept connections over the " \ + "loopback device") option('-i', "--interactive", action="store_true", default=False, help="Invoke the interactive interpreter after running the script") option("--pdb", action="store_true", default=False, @@ -352,6 +355,9 @@ def main(*args): else: panic("Unhandled listener mode: %s" % options.listener_mode) + if options.listener_loopback_only: + m5.listenersLoopbackOnly() + # set debugging options debug.setRemoteGDBPort(options.remote_gdb_port) for when in options.debug_break: |