#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org

START=25
start() {
	[ -f /etc/sysctl.conf ] && {
		sysctl -p -e >&-
		[ -d /lib/vnet/ ] && {
			vnete sysctl -p -e >&-
			vnete sysctl -w net.ipv4.ip_forward=1
		}
        #set max_dgram_qlen here to fix bug929957
		local MAX_DGRAM_QLEN=$(uci -c /etc/profile.d -q get profile.@sysctl_conf[0].max_dgram_qlen)
		if [ -n "$MAX_DGRAM_QLEN" ]; then
			sysctl -w net.unix.max_dgram_qlen="$MAX_DGRAM_QLEN"
		fi
		## fix bug 961835
		## set ip_forward_use_pmtu and route min_pmtu, 1052 is the value of mikrotik
		sysctl -w net.ipv4.ip_forward_use_pmtu=1
		sysctl -w net.ipv4.route.min_pmtu=1052
	}
}
