From e926c11ff8ec60029166479a4577ced4fbe348d6 Mon Sep 17 00:00:00 2001 From: Vicente Date: Tue, 18 Jun 2013 19:41:46 +0200 Subject: [PATCH] dnscrypto-proxy: Support files updated. --- release/src/router/Makefile | 12 ++++++++++-- release/src/router/httpd/tomato.c | 4 +++- release/src/router/nvram/defaults.c | 29 +++++++++++++---------------- release/src/router/rc/services.c | 7 +++++-- release/src/router/www/basic-network.asp | 13 +++++++++---- 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/release/src/router/Makefile b/release/src/router/Makefile index 48622465ab..081fb1b622 100644 --- a/release/src/router/Makefile +++ b/release/src/router/Makefile @@ -824,6 +824,7 @@ ntfs-3g/Makefile: LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC" \ $(CONFIGURE) --enable-shared=no --enable-static=no \ --disable-library --disable-ldconfig --disable-mount-helper --with-fuse=internal \ + --disable-ntfsprogs --disable-crypto --without-uuid \ --disable-posix-acls --disable-nfconv --disable-dependency-tracking ntfs-3g: ntfs-3g/Makefile @@ -1561,12 +1562,18 @@ libpcap-clean: libpcap-install: @$(SEP) -dnscrypt/stamp-h1: +libsodium/stamp-h1: + cd $(TOP)/libsodium && CC=$(CC) STRIP='mipsel-uclibc-strip' \ + $(CONFIGURE) --prefix=/usr --disable-ssp + touch libsodium/stamp-h1 + +dnscrypt/stamp-h1: libsodium/stamp-h1 cd $(TOP)/dnscrypt && CC=$(CC) STRIP='mipsel-uclibc-strip' \ $(CONFIGURE) --prefix=/usr --disable-ssp touch dnscrypt/stamp-h1 dnscrypt: dnscrypt/stamp-h1 + $(MAKE) -C dnscrypt $(PARALLEL_BUILD) dnscrypt-install: dnscrypt install -D dnscrypt/src/proxy/dnscrypt-proxy $(INSTALLDIR)/dnscrypt/usr/sbin/dnscrypt-proxy @@ -1576,7 +1583,8 @@ dnscrypt-install: dnscrypt dnscrypt-clean: -@$(MAKE) -C dnscrypt clean - @rm -rf dnscrypt/stamp-h1 dnscrypt/src/dnscrypt-proxy/.deps dnscrypt/Makefile + -@$(MAKE) -C libsodium clean + @rm -rf dnscrypt/stamp-h1 dnscrypt/src/dnscrypt-proxy/.deps dnscrypt/Makefile libsodium/stamp-h1 tcpdump/stamp-h1: openssl libpcap cd tcpdump && \ diff --git a/release/src/router/httpd/tomato.c b/release/src/router/httpd/tomato.c index 39d0642446..63641c00f1 100644 --- a/release/src/router/httpd/tomato.c +++ b/release/src/router/httpd/tomato.c @@ -569,7 +569,9 @@ static const nvset_t nvset_list[] = { { "pppoe_lef", V_RANGE(0, 10) }, #ifdef TCONFIG_DNSCRYPT - { "dnscrypt_proxy", V_01 }, + { "dnscrypt_proxy", V_01 }, + { "dnscrypt_port", V_PORT }, + { "dnscrypt_cmd", V_LENGTH(0, 256) }, #endif // LAN diff --git a/release/src/router/nvram/defaults.c b/release/src/router/nvram/defaults.c index a34578eaf6..f716ebda31 100644 --- a/release/src/router/nvram/defaults.c +++ b/release/src/router/nvram/defaults.c @@ -89,15 +89,16 @@ const defaults_t defaults[] = { { "wan_gateway", "0.0.0.0" }, // WAN gateway { "wan_gateway_get", "0.0.0.0" }, // default gateway for PPP { "wan_dns", "" }, // x.x.x.x x.x.x.x ... +#ifdef TCONFIG_DNSCRYPT + { "dnscrypt_proxy", "" }, + { "dnscrypt_port", "40" }, // local port + { "dnscrypt_cmd", "-m 99" }, // optional arguments +#endif { "wan_wins", "" }, // x.x.x.x x.x.x.x ... { "wan_lease", "86400" }, // WAN lease time in seconds { "wan_islan", "0" }, { "modem_ipaddr", "0.0.0.0" }, // modem IP address (i.e. PPPoE bridged modem) -#ifdef TCONFIG_DNSCRYPT - { "dnscrypt_proxy", "" }, -#endif - { "wan_primary", "1" }, // Primary wan connection { "wan_unit", "0" }, // Last configured connection /* --- obsolete --- @@ -142,7 +143,7 @@ const defaults_t defaults[] = { //3G parameters { "modem_pin", "" }, - { "modem_dev", "USB0" }, + { "modem_dev", "ttyUSB0" }, { "modem_init", "*99#" }, { "modem_apn", "internet" }, @@ -157,7 +158,6 @@ const defaults_t defaults[] = { { "ppp_mru", "1500" }, // Negotiate MRU to this value { "ppp_mtu", "1500" }, // Negotiate MTU to the smaller of this value or the peer MRU { "ppp_service", "" }, // PPPoE service name - { "ppp_ac", "" }, // PPPoE access concentrator name { "ppp_static", "0" }, // Enable / Disable Static IP { "ppp_static_ip", "" }, // PPPoE Static IP { "ppp_custom", "" }, // PPPD additional options @@ -324,14 +324,14 @@ const defaults_t defaults[] = { { "wl_rxchain_pwrsave_quiet_time","1800" }, // Quiet time for power save { "wl_rxchain_pwrsave_pps", "10" }, // Packets per second threshold for power save { "wl_radio_pwrsave_enable", "0" }, // Radio powersave enable - { "wl_radio_pwrsave_quiet_time", "1800" }, // Quiet time for power save + { "wl_radio_pwrsave_quiet_time", "1800" }, // Quiet time for power save { "wl_radio_pwrsave_pps", "10" }, // Packets per second threshold for power save - { "wl_radio_pwrsave_on_time", "50" }, // Radio on time for power save + { "wl_radio_pwrsave_on_time", "50" }, // Radio on time for power save // misc { "wl_wmf_bss_enable", "0" }, // Wireless Multicast Forwarding Enable/Disable { "wl_rifs_advert", "auto" }, // RIFS mode advertisement { "wl_stbc_tx", "auto" }, // Default STBC TX setting - { "wl_mcast_regen_bss_enable", "1" }, // MCAST REGEN Enable/Disable + { "wl_mcast_regen_bss_enable", "1" }, // MCAST REGEN Enable/Disable #endif { "pptp_server_ip", "" }, // as same as WAN gateway @@ -377,9 +377,6 @@ const defaults_t defaults[] = { { "ntp_updates", "4" }, { "ntp_tdod", "0" }, { "ntp_server", "0.europe.pool.ntp.org 1.europe.pool.ntp.org 2.europe.pool.ntp.org" }, -#ifdef TCONFIG_DNSCRYPT - { "ntp_server_ip", "205.233.73.201 83.133.106.119 81.88.24.155 81.94.123.17 91.234.160.19 82.197.164.46 184.105.192.247 195.216.64.208" }, // shibby - when dnscrypt-proxy 1, have to use ip addresses -#endif { "ntp_kiss", "" }, { "ntp_kiss_ignore", "" }, { "ntpd_enable", "0" }, @@ -616,7 +613,7 @@ const defaults_t defaults[] = { { "rstats_bak", "0" }, // admin-ipt - { "cstats_enable", "0" }, + { "cstats_enable", "1" }, { "cstats_path", "" }, { "cstats_stime", "48" }, { "cstats_offset", "1" }, @@ -676,9 +673,9 @@ const defaults_t defaults[] = { // admin-debugging { "debug_nocommit", "0" }, { "debug_cprintf", "0" }, - { "debug_cprintf_file", "0" }, -// { "debug_keepfiles", "0" }, - { "console_loglevel", "1" }, + { "debug_cprintf_file", "0" }, +// { "debug_keepfiles", "0" }, + { "console_loglevel", "1" }, { "t_cafree", "1" }, { "t_hidelr", "0" }, { "debug_clkfix", "1" }, diff --git a/release/src/router/rc/services.c b/release/src/router/rc/services.c index fe62f3989d..6497f44870 100644 --- a/release/src/router/rc/services.c +++ b/release/src/router/rc/services.c @@ -149,7 +149,7 @@ void start_dnsmasq() #ifdef TCONFIG_DNSCRYPT if (nvram_match("dnscrypt_proxy", "1")) { - fprintf(f, "server=127.0.0.1#40\n"); + fprintf(f, "server=127.0.0.1#%s\n", nvram_safe_get("dnscrypt_port") ); } #endif @@ -446,7 +446,10 @@ void start_dnsmasq() //start dnscrypt-proxy if (nvram_match("dnscrypt_proxy", "1")) { eval("ntp2ip"); - eval("dnscrypt-proxy", "-d", "-P", "40"); + + char dnscrypt_local[30]; + sprintf(dnscrypt_local, "127.0.0.1:%s", nvram_safe_get("dnscrypt_port") ); + eval("dnscrypt-proxy", "-d", "-a", dnscrypt_local, nvram_safe_get("dnscrypt_cmd") ); } #endif diff --git a/release/src/router/www/basic-network.asp b/release/src/router/www/basic-network.asp index 486749f8a5..f4888b3e6a 100644 --- a/release/src/router/www/basic-network.asp +++ b/release/src/router/www/basic-network.asp @@ -45,7 +45,7 @@