From: Benjamin Cama Date: Sun, 24 Jul 2011 11:49:11 +0000 (+0200) Subject: Add a cli_bind_address configuration option. X-Git-Tag: debian/2.2.1-1fdn1~1^2~5 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/8321e71491fd2257db39966a511b1a1afcf44722?ds=sidebyside Add a cli_bind_address configuration option. Signed-off-by: Benjamin Cama --- diff --git a/cli.c b/cli.c index 8377339..9433106 100644 --- a/cli.c +++ b/cli.c @@ -283,6 +283,7 @@ void init_cli(char *hostname) fcntl(clifd, F_SETFL, flags | O_NONBLOCK); } addr.sin_family = AF_INET; + addr.sin_addr.s_addr = config->cli_bind_address; /* defaults to INADDR_ANY */ addr.sin_port = htons(23); if (bind(clifd, (void *) &addr, sizeof(addr)) < 0) { diff --git a/etc/startup-config.default b/etc/startup-config.default index 77425c8..d6488dc 100644 --- a/etc/startup-config.default +++ b/etc/startup-config.default @@ -53,6 +53,9 @@ set accounting_dir "/var/run/l2tpns/acct" # Listen address for L2TP #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 #set send_garp no diff --git a/l2tpns.c b/l2tpns.c index 9947bd5..f966a78 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -157,6 +157,7 @@ config_descriptt config_values[] = { CONFIG("cluster_hb_timeout", cluster_hb_timeout, INT), CONFIG("cluster_master_min_adv", cluster_master_min_adv, INT), CONFIG("ipv6_prefix", ipv6_prefix, IPv6), + CONFIG("cli_bind_address", cli_bind_address, IPv4), { NULL, 0, 0, 0 }, }; diff --git a/l2tpns.h b/l2tpns.h index 032c237..76e9aa2 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -712,6 +712,7 @@ typedef struct int cluster_master_min_adv; // Master advertises routes while the number of up to date // slaves is less than this value. + in_addr_t cli_bind_address; // bind address for CLI // Guest change char guest_user[MAXUSER]; // Guest account username