From 348b6e728a3d01cfc3c5698c4f68565cfa3ac2bb Mon Sep 17 00:00:00 2001 From: oblique Date: Sun, 20 Sep 2015 12:17:48 +0300 Subject: [PATCH] Send MTU via DHCP Fix #108 --- create_ap | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/create_ap b/create_ap index 4864951..a06cd4e 100755 --- a/create_ap +++ b/create_ap @@ -354,6 +354,11 @@ get_macaddr() { cat "/sys/class/net/${1}/address" } +get_mtu() { + is_interface "$1" || return + cat "/sys/class/net/${1}/mtu" +} + alloc_new_iface() { local prefix=$1 local i=0 @@ -1529,6 +1534,8 @@ ${DNSMASQ_BIND} dhcp-range=${GATEWAY%.*}.1,${GATEWAY%.*}.254,255.255.255.0,24h dhcp-option=option:router,${GATEWAY} EOF + MTU=$(get_mtu $INTERNET_IFACE) + [[ -n "$MTU" ]] && echo "dhcp-option=option:mtu,${MTU}" >> $CONFDIR/dnsmasq.conf [[ $ETC_HOSTS -eq 0 ]] && echo no-hosts >> $CONFDIR/dnsmasq.conf fi