add <ifname>_mtu setting for dhcp and static
authorFelix Fietkau <nbd@openwrt.org>
Mon, 20 Mar 2006 00:10:53 +0000 (00:10 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 20 Mar 2006 00:10:53 +0000 (00:10 +0000)
SVN-Revision: 3412

openwrt/package/base-files/default/etc/functions.sh

index c1828d5448047f5c38435fb15105327ee67681b8..7c31539721fd275a7fe654ecf5aaa271c8aaf4b3 100755 (executable)
@@ -45,8 +45,9 @@ do_ifup() {
                ip=$(nvram get ${2}_ipaddr)
                netmask=$(nvram get ${2}_netmask)
                gateway=$(nvram get ${2}_gateway)
+               mtu=$(nvram get ${2}_mtu)
 
-               $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
+               $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} ${mtu:+mtu $(($mtu))} broadcast + up
                ${gateway:+$DEBUG route add default gw $gateway}
 
                [ -f /etc/resolv.conf ] || {
@@ -61,7 +62,8 @@ do_ifup() {
        dhcp)
                DHCP_IP=$(nvram get ${2}_ipaddr)
                DHCP_NETMASK=$(nvram get ${2}_netmask)
-               $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} broadcast + up
+               mtu=$(nvram get ${2}_mtu)
+               $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} ${mtu:+mtu $(($mtu))} broadcast + up
 
                DHCP_ARGS="-i $if ${DHCP_IP:+-r $DHCP_IP} -b -p $pidfile"
                DHCP_HOSTNAME=$(nvram get ${2}_hostname)