1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
7 local mem
="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
8 local min_free frag_low_thresh frag_high_thresh
10 if [ "$mem" -gt 65536 ]; then # 128M
12 elif [ "$mem" -gt 32768 ]; then # 64M
16 frag_low_thresh
=393216
17 frag_high_thresh
=524288
20 sysctl
-qw vm.min_free_kbytes
="$min_free"
22 [ "$frag_low_thresh" ] && sysctl
-qw \
23 net.ipv4.ipfrag_low_thresh
="$frag_low_thresh" \
24 net.ipv4.ipfrag_high_thresh
="$frag_high_thresh" \
25 net.ipv6.ip6frag_low_thresh
="$frag_low_thresh" \
26 net.ipv6.ip6frag_high_thresh
="$frag_high_thresh" \
27 net.netfilter.nf_conntrack_frag6_low_thresh
="$frag_low_thresh" \
28 net.netfilter.nf_conntrack_frag6_high_thresh
="$frag_high_thresh"
33 for CONF
in /etc
/sysctl.conf
/etc
/sysctl.d
/*.conf
; do
34 [ -f "$CONF" ] && sysctl
-p "$CONF" -e >&-