From: bodea Date: Fri, 5 Nov 2004 02:47:47 +0000 (+0000) Subject: add peer_address config option X-Git-Tag: release_2_0_4~5 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/91b978f4a8d79faa7c00ffa2147e874c8b7e7f3b?ds=inline;hp=014cd8c15d4644788915ed616e2a5ad2dd22b934 add peer_address config option --- diff --git a/Changes b/Changes index 8336c72..0db4110 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +? Brendan O'Dea 2.0.4 +- Added setrxspeed plugin +- Added peer_address config option + * Wed Nov 3 2004 Brendan O'Dea 2.0.3 - Added support for hidden AVPs by Robert Clark - l2tpns-chap-response.patch from Robert Clark diff --git a/cli.c b/cli.c index 583ca83..0ce3a4f 100644 --- a/cli.c +++ b/cli.c @@ -2,7 +2,7 @@ // vim: sw=8 ts=8 char const *cvs_name = "$Name: $"; -char const *cvs_id_cli = "$Id: cli.c,v 1.22 2004/11/04 23:41:54 bodea Exp $"; +char const *cvs_id_cli = "$Id: cli.c,v 1.23 2004/11/05 02:47:47 bodea Exp $"; #include #include @@ -538,7 +538,7 @@ int cmd_show_tunnels(struct cli_def *cli, char *command, char **argv, int argc) for (i = 1; i < MAXTUNNEL; i++) { int sessions = 0; - if (!show_all && (!tunnel[i].ip || tunnel[i].die || !tunnel[i].hostname[0])) continue; + if (!show_all && (!tunnel[i].ip || tunnel[i].die)) continue; for (x = 0; x < MAXSESSION; x++) if (session[x].tunnel == i && session[x].opened && !session[x].die) sessions++; cli_print(cli, "%4d %20s %20s %6s %6d", diff --git a/l2tpns.c b/l2tpns.c index 35a04b4..02bc182 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -4,7 +4,7 @@ // Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced // vim: sw=8 ts=8 -char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.42 2004/11/05 02:25:25 bodea Exp $"; +char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.43 2004/11/05 02:47:47 bodea Exp $"; #include #include @@ -107,6 +107,7 @@ struct config_descriptt config_values[] = { CONFIG("radius_accounting", radius_accounting, BOOL), CONFIG("radius_secret", radiussecret, STRING), CONFIG("bind_address", bind_address, IP), + CONFIG("peer_address", peer_address, IP), CONFIG("send_garp", send_garp, BOOL), CONFIG("throttle_speed", rl_rate, UNSIGNED_LONG), CONFIG("throttle_buckets", num_tbfs, INT), @@ -1127,7 +1128,10 @@ void sendipcp(tunnelidt t, sessionidt s) *(u16 *) (q + 2) = htons(10); q[4] = 3; q[5] = 6; - *(u32 *) (q + 6) = config->bind_address ? config->bind_address : my_address; // send my IP + *(u32 *) (q + 6) = config->peer_address ? config->peer_address : + config->bind_address ? config->bind_address : + my_address; // send my IP + tunnelsend(buf, 10 + (q - buf), t); // send it session[s].flags &= ~SF_IPCP_ACKED; // Clear flag. } diff --git a/l2tpns.h b/l2tpns.h index 7df1cc6..1c628c6 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -1,5 +1,5 @@ // L2TPNS Global Stuff -// $Id: l2tpns.h,v 1.28 2004/11/03 13:23:59 bodea Exp $ +// $Id: l2tpns.h,v 1.29 2004/11/05 02:47:47 bodea Exp $ #ifndef __L2TPNS_H__ #define __L2TPNS_H__ @@ -427,6 +427,7 @@ struct configt int save_state; char accounting_dir[128]; ipt bind_address; + ipt peer_address; int send_garp; // Set to true to garp for vip address on startup int target_uid;