Skip to content

Commit 5835899

Browse files
author
voxel
committed
RNDIS modem scheme change. Decrease rmem/wmem values, change default congestion to westwood+
1 parent c00cc23 commit 5835899

File tree

7 files changed

+37
-34
lines changed

7 files changed

+37
-34
lines changed

git_home/net-wall.git/net-wall

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
#!/bin/sh
22

3-
if [ ! -f /tmp/modem ]; then
4-
/usr/sbin/net-wall-bin $*
5-
else
6-
/usr/sbin/net-wall-bin -w eth0 $*
7-
fi
3+
# Run original firewall
4+
/usr/sbin/net-wall-bin $*
85

96
if [ "$1" = "rule" ]; then
10-
# Add own rules and remove "_lz4" occurrences if any
11-
sed 's/_lz4//g' /tmp/netwall-rules > /tmp/netwall-rules.tmp
7+
# Store rules of original firewall
8+
cat /tmp/netwall-rules > /tmp/netwall-rules.tmp
129

1310
# Check config file existence, add own rules if exists
1411
if [ -f /etc/netwall.conf ]; then

git_home/ntpclient.git/dniconfig.h

-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
* you can replace with yours.
44
*/
55
#define NET_IFNAME "brwan" /* The router's wan side interface name. */
6-
#define CDC_IFNAME "eth0" /* The router's CDC modem side interface name. */
76
#define PPP_IFNAME "ppp0"
8-
#define MODEM "/tmp/modem"
97

108
#define NETGEAR_DAYLIGHT_SAVING_TIME
119

git_home/ntpclient.git/ntpclient.c

-7
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,6 @@ static int wan_conn_up(void)
702702
{
703703
int mode, alive;
704704
struct in_addr ip;
705-
struct stat statbuf;
706-
707-
if (stat(MODEM, &statbuf) == 0)
708-
{
709-
ip = get_ipaddr(CDC_IFNAME);
710-
return ip.s_addr != 0;
711-
}
712705

713706
alive = net_verified(&mode);
714707
if (alive == 0)
+26-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh /etc/rc.common
22
START=99
33

4+
PATH=/bin:/sbin:/usr/bin:/usr/sbin
45
CONFIG=/bin/config
56
AP_MODE=$($CONFIG get ap_mode)
67
BRIDGE_MODE=$($CONFIG get bridge_mode)
@@ -9,34 +10,47 @@ KVER=`uname -r | cut -f 1`
910
MODULE_PATH=/lib/modules/$KVER
1011

1112
start() {
12-
# Check if not router mode
13+
# Check: is router mode, exit if "no"
1314
if [ "$AP_MODE" != "0" ] || [ "$BRIDGE_MODE" != "0" ] || [ "$EXTENDER_MODE" != "0" ]; then
1415
exit 0;
1516
fi
1617

17-
# Check is cable attached to WAN port, exit if "yes"
18+
# Check: is cable attached to WAN port, exit if "yes"
1819
detcable show | grep "WAN : Plug in" > /dev/null
1920
if [ $? -eq 0 ]; then
2021
exit 0;
2122
fi
2223

23-
# Add kernel object and switch mode of modem
24-
/sbin/insmod $MODULE_PATH/rndis_host.ko
25-
/sbin/usbmode -s
26-
/bin/sleep 10
24+
# Try to load kernel object, switch modem mode and up interface eth0
25+
insmod $MODULE_PATH/rndis_host.ko
26+
usbmode -s
27+
sleep 10
28+
ifconfig eth0 up
2729

28-
# Check is modem attached
29-
/sbin/ifconfig eth0 up
30+
# Check: is modem attached
3031
if [ $? -eq 0 ]; then
32+
# Attached, rename eth0 to brwan
33+
ifconfig eth0 down
34+
ip link delete brwan
35+
ip link set eth0 name brwan
36+
ifconfig brwan up
37+
38+
# Stop services
3139
/etc/init.d/net-wan stop
3240
/etc/init.d/detcable stop
3341
/etc/init.d/watchdog stop
34-
echo -n 1 > /tmp/port_status
42+
/etc/init.d/ntpclient stop
3543
echo modem > /tmp/modem
44+
echo -n 1 > /tmp/port_status
45+
46+
# Start services and restart firewall
3647
/etc/init.d/net-wan start
37-
/usr/sbin/net-wall restart
48+
net-wall restart
49+
killall ntpclient
50+
sleep 15
51+
/etc/init.d/ntpclient start
3852
else
39-
# No modem found, restore kernel objects
40-
/sbin/rmmod rndis_host
53+
# No modem found, just unload kernel objects
54+
rmmod rndis_host
4155
fi
4256
}

package/base-files/files/etc/init.d/net-wan

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
FIREWALL="/www/cgi-bin/firewall.sh"
55
DHCPNAME="/tmp/dhcp_name.conf"
6-
if [ -f /tmp/modem ]; then
7-
WAN_IF=eth0
8-
fi
96

107
check_qca_nss() {
118
local proto=$($CONFIG get wan_proto)

package/base-files/files/etc/sysctl.conf

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ net.ipv4.ip_option_rr_ssrr_lsrr_pass_through=1
77
net.ipv4.ipfrag_overlap_drop=1
88
net.ipv4.icmp_echo_ignore_broadcasts=1
99
net.ipv4.icmp_ignore_bogus_error_responses=1
10-
net.ipv4.tcp_congestion_control=yeah
10+
net.ipv4.tcp_congestion_control=westwood
1111
net.ipv4.tcp_ecn=0
1212
net.ipv4.tcp_fin_timeout=60
1313
net.ipv4.tcp_keepalive_time=7200
1414
net.ipv4.tcp_syncookies=0
1515
net.ipv4.tcp_timestamps=1
16+
net.ipv4.tcp_rmem=4096 87380 6291456
17+
net.ipv4.tcp_wmem=4096 16384 4194304
1618
net.ipv4.udp_ssdp_deliver_all=1
1719
net.core.netdev_max_backlog=1000
18-
net.core.rmem_max = 524288
19-
net.core.wmem_max = 524288
20+
net.core.rmem_default=212992
21+
net.core.wmem_default=212992
22+
net.core.rmem_max=212992
23+
net.core.wmem_max=212992
2024
net.netfilter.nf_conntrack_checksum=0
2125
net.netfilter.nf_conntrack_expect_max=32
2226
net.netfilter.nf_conntrack_acct=1
Binary file not shown.

0 commit comments

Comments
 (0)