1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
diff -urNad dynamips~/dev_vtty.c dynamips/dev_vtty.c
--- dynamips~/dev_vtty.c 2007-10-17 07:35:50.000000000 +0200
+++ dynamips/dev_vtty.c 2009-01-29 00:31:41.000000000 +0100
@@ -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) {
|