From 870616169bce98c099f5bf273eb66e584db23de0 Mon Sep 17 00:00:00 2001 From: Lancethepants Date: Wed, 13 Aug 2014 13:44:24 +0700 Subject: [PATCH] Add gui for Comcast DSCP fix. Author: lancethepants --- release/src/router/httpd/tomato.c | 1 + release/src/router/nvram/defaults.c | 1 + release/src/router/rc/firewall.c | 8 +++++--- release/src/router/www/advanced-firewall.asp | 7 +++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/release/src/router/httpd/tomato.c b/release/src/router/httpd/tomato.c index afab92ffa3..5eb7b93aa5 100644 --- a/release/src/router/httpd/tomato.c +++ b/release/src/router/httpd/tomato.c @@ -748,6 +748,7 @@ static const nvset_t nvset_list[] = { { "block_loopback", V_01 }, { "nf_loopback", V_NUM }, { "ne_syncookies", V_01 }, + { "DSCP_fix_enable", V_01 }, { "ne_snat", V_01 }, { "dhcp_pass", V_01 }, #ifdef TCONFIG_EMF diff --git a/release/src/router/nvram/defaults.c b/release/src/router/nvram/defaults.c index e63c8cb829..d938fb5193 100644 --- a/release/src/router/nvram/defaults.c +++ b/release/src/router/nvram/defaults.c @@ -455,6 +455,7 @@ const defaults_t defaults[] = { { "udpxy_clients", "3" }, { "udpxy_port", "4022" }, { "ne_syncookies", "0" }, // tcp_syncookies + { "DSCP_fix_enable", "1" }, // Comacst DSCP fix { "ne_snat", "0" }, // use SNAT instead of MASQUERADE { "dhcp_pass", "1" }, // allow DHCP responses { "ne_shlimit", "0,3,60" }, diff --git a/release/src/router/rc/firewall.c b/release/src/router/rc/firewall.c index ebf43964de..81a8ae79e8 100644 --- a/release/src/router/rc/firewall.c +++ b/release/src/router/rc/firewall.c @@ -618,12 +618,14 @@ static void mangle_table(void) #endif } // Reset Incoming DSCP to 0x00 + if (nvram_match("DSCP_fix_enable", "1")) { #ifdef LINUX26 - modprobe("xt_DSCP"); + modprobe("xt_DSCP"); #else - modprobe("ipt_DSCP"); + modprobe("ipt_DSCP"); #endif - ipt_write("-I PREROUTING -i %s -j DSCP --set-dscp 0\n", wanface); + ipt_write("-I PREROUTING -i %s -j DSCP --set-dscp 0\n", wanface); + } } ip46t_write("COMMIT\n"); diff --git a/release/src/router/www/advanced-firewall.asp b/release/src/router/www/advanced-firewall.asp index 7107d222eb..97f365813c 100644 --- a/release/src/router/www/advanced-firewall.asp +++ b/release/src/router/www/advanced-firewall.asp @@ -26,7 +26,7 @@ -- 2.11.4.GIT