Package: dynamips
Version: 0.5-1
Severity: normal
dynamips binds the TCP console ports to 0.0.0.0, even if you start the
hypervisor with -H 127.0.0.1
Attached is a patch that fixes this. It is a bit hackish, but I think
the idea is sound.
- Justin
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
--- dev_vtty.c.orig 2007-10-17 01:35:50.000000000 -0400
+++ dev_vtty.c 2008-11-05 19:48:00.000000000 -0500
@@ -25,6 +25,7 @@
#include <errno.h>
#include <assert.h>
+#include <arpa/inet.h>
#include <arpa/telnet.h>
#include "utils.h"
@@ -47,6 +48,7 @@
static pthread_mutex_t vtty_list_mutex = PTHREAD_MUTEX_INITIALIZER;
static vtty_t *vtty_list = NULL;
static pthread_t vtty_thread;
+extern char *hypervisor_ip_address;
#define VTTY_LIST_LOCK() pthread_mutex_lock(&vtty_list_mutex);
#define VTTY_LIST_UNLOCK() pthread_mutex_unlock(&vtty_list_mutex);
@@ -139,7 +141,8 @@
memset(&serv,0,sizeof(serv));
serv.sin_family = AF_INET;
- serv.sin_addr.s_addr = htonl(INADDR_ANY);
+ serv.sin_addr.s_addr = (hypervisor_ip_address && strlen(hypervisor_ip_address)) ?
+ inet_addr(hypervisor_ip_address) : htonl(INADDR_ANY);
serv.sin_port = htons(vtty->tcp_port);
if (bind(vtty->accept_fd,(struct sockaddr *)&serv,sizeof(serv)) < 0) {