Add a cli_bind_address configuration option.

Signed-off-by: Benjamin Cama <benoar@dolka.fr>
This commit is contained in:
Benjamin Cama 2011-07-24 13:49:11 +02:00
parent d48de5fddd
commit 8321e71491
4 changed files with 6 additions and 0 deletions

1
cli.c
View file

@ -283,6 +283,7 @@ void init_cli(char *hostname)
fcntl(clifd, F_SETFL, flags | O_NONBLOCK); fcntl(clifd, F_SETFL, flags | O_NONBLOCK);
} }
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_addr.s_addr = config->cli_bind_address; /* defaults to INADDR_ANY */
addr.sin_port = htons(23); addr.sin_port = htons(23);
if (bind(clifd, (void *) &addr, sizeof(addr)) < 0) if (bind(clifd, (void *) &addr, sizeof(addr)) < 0)
{ {

View file

@ -53,6 +53,9 @@ set accounting_dir "/var/run/l2tpns/acct"
# Listen address for L2TP # Listen address for L2TP
#set bind_address 1.1.1.1 #set bind_address 1.1.1.1
# Listen address for CLI
#set cli_bind_address 1.1.1.1
# Send a gratiuitous ARP for bind address # Send a gratiuitous ARP for bind address
#set send_garp no #set send_garp no

View file

@ -157,6 +157,7 @@ config_descriptt config_values[] = {
CONFIG("cluster_hb_timeout", cluster_hb_timeout, INT), CONFIG("cluster_hb_timeout", cluster_hb_timeout, INT),
CONFIG("cluster_master_min_adv", cluster_master_min_adv, INT), CONFIG("cluster_master_min_adv", cluster_master_min_adv, INT),
CONFIG("ipv6_prefix", ipv6_prefix, IPv6), CONFIG("ipv6_prefix", ipv6_prefix, IPv6),
CONFIG("cli_bind_address", cli_bind_address, IPv4),
{ NULL, 0, 0, 0 }, { NULL, 0, 0, 0 },
}; };

View file

@ -712,6 +712,7 @@ typedef struct
int cluster_master_min_adv; // Master advertises routes while the number of up to date int cluster_master_min_adv; // Master advertises routes while the number of up to date
// slaves is less than this value. // slaves is less than this value.
in_addr_t cli_bind_address; // bind address for CLI
// Guest change // Guest change
char guest_user[MAXUSER]; // Guest account username char guest_user[MAXUSER]; // Guest account username