From 8499a408c600c415cdd08c1d86b0ae13d169f078 Mon Sep 17 00:00:00 2001 From: Keith Moyer Date: Mon, 10 Aug 2009 22:14:12 -0500 Subject: [PATCH] Option to leave comp-lzo out --- release/src/router/rc/vpn.c | 6 ++++-- release/src/router/www/vpn-client.asp | 2 +- release/src/router/www/vpn-server.asp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/release/src/router/rc/vpn.c b/release/src/router/rc/vpn.c index 90ec771f0a..9f05744bc3 100644 --- a/release/src/router/rc/vpn.c +++ b/release/src/router/rc/vpn.c @@ -188,7 +188,8 @@ void start_vpnclient(int clientNum) fprintf(fp, "persist-key\n"); fprintf(fp, "persist-tun\n"); sprintf(&buffer[0], "vpn_client%d_comp", clientNum); - fprintf(fp, "comp-lzo %s\n", nvram_safe_get(&buffer[0])); + if ( nvram_get_int(&buffer[0]) >= 0 ) + fprintf(fp, "comp-lzo %s\n", nvram_safe_get(&buffer[0])); sprintf(&buffer[0], "vpn_client%d_cipher", clientNum); if ( !nvram_contains_word(&buffer[0], "default") ) fprintf(fp, "cipher %s\n", nvram_safe_get(&buffer[0])); @@ -537,7 +538,8 @@ void start_vpnserver(int serverNum) if ( !nvram_contains_word(&buffer[0], "default") ) fprintf(fp, "cipher %s\n", nvram_safe_get(&buffer[0])); sprintf(&buffer[0], "vpn_server%d_comp", serverNum); - fprintf(fp, "comp-lzo %s\n", nvram_safe_get(&buffer[0])); + if ( nvram_get_int(&buffer[0]) >= 0 ) + fprintf(fp, "comp-lzo %s\n", nvram_safe_get(&buffer[0])); sprintf(&buffer[0], "vpn_server%d_reneg", serverNum); if ( (nvl = atol(nvram_safe_get(&buffer[0]))) >= 0 ) fprintf(fp, "reneg-sec %ld\n", nvl); diff --git a/release/src/router/www/vpn-client.asp b/release/src/router/www/vpn-client.asp index 7668466c94..94ea339e49 100644 --- a/release/src/router/www/vpn-client.asp +++ b/release/src/router/www/vpn-client.asp @@ -323,7 +323,7 @@ for (i = 0; i < tabs.length; ++i) { name: 'vpn_'+t+'_gw', type: 'text', maxlen: 15, size: 17, value: eval( 'nvram.vpn_'+t+'_gw' ), prefix: 'Gateway: ', suffix: ''} ] }, { title: 'Accept DNS configuration', name: 'vpn_'+t+'_adns', type: 'select', options: [[0, 'Disabled'],[1, 'Relaxed'],[2, 'Strict'],[3, 'Exclusive']], value: eval( 'nvram.vpn_'+t+'_adns' ) }, { title: 'Encryption cipher', name: 'vpn_'+t+'_cipher', type: 'select', options: ciphers, value: eval( 'nvram.vpn_'+t+'_cipher' ) }, - { title: 'Compression', name: 'vpn_'+t+'_comp', type: 'select', options: [ ['yes', 'Enabled'], ['no', 'Disabled'], ['adaptive', 'Adaptive'] ], value: eval( 'nvram.vpn_'+t+'_comp' ) }, + { title: 'Compression', name: 'vpn_'+t+'_comp', type: 'select', options: [ ['-1', 'Disabled'], ['no', 'None'], ['yes', 'Enabled'], ['adaptive', 'Adaptive'] ], value: eval( 'nvram.vpn_'+t+'_comp' ) }, { title: 'TLS Renegotiation Time', name: 'vpn_'+t+'_reneg', type: 'text', maxlen: 10, size: 7, value: eval( 'nvram.vpn_'+t+'_reneg' ), suffix: ' (in seconds, -1 for default)' }, { title: 'Connection retry', name: 'vpn_'+t+'_retry', type: 'text', maxlen: 5, size: 7, value: eval( 'nvram.vpn_'+t+'_retry' ), diff --git a/release/src/router/www/vpn-server.asp b/release/src/router/www/vpn-server.asp index 5b6c606c9b..d20ce0c66d 100644 --- a/release/src/router/www/vpn-server.asp +++ b/release/src/router/www/vpn-server.asp @@ -451,7 +451,7 @@ for (i = 0; i < tabs.length; ++i) { title: 'Respond to DNS', name: 'f_vpn_'+t+'_dns', type: 'checkbox', value: nvram.vpn_server_dns.indexOf(''+(i+1)) >= 0 }, { title: 'Advertise DNS to clients', name: 'f_vpn_'+t+'_pdns', type: 'checkbox', value: eval( 'nvram.vpn_'+t+'_pdns' ) != 0 }, { title: 'Encryption cipher', name: 'vpn_'+t+'_cipher', type: 'select', options: ciphers, value: eval( 'nvram.vpn_'+t+'_cipher' ) }, - { title: 'Compression', name: 'vpn_'+t+'_comp', type: 'select', options: [ ['yes', 'Enabled'], ['no', 'Disabled'], ['adaptive', 'Adaptive'] ], value: eval( 'nvram.vpn_'+t+'_comp' ) }, + { title: 'Compression', name: 'vpn_'+t+'_comp', type: 'select', options: [ ['-1', 'Disabled'], ['no', 'None'], ['yes', 'Enabled'], ['adaptive', 'Adaptive'] ], value: eval( 'nvram.vpn_'+t+'_comp' ) }, { title: 'TLS Renegotiation Time', name: 'vpn_'+t+'_reneg', type: 'text', maxlen: 10, size: 7, value: eval( 'nvram.vpn_'+t+'_reneg' ), suffix: ' (in seconds, -1 for default)' }, { title: 'Manage Client-Specific Options', name: 'f_vpn_'+t+'_ccd', type: 'checkbox', value: eval( 'nvram.vpn_'+t+'_ccd' ) != 0 }, -- 2.11.4.GIT