hotplug/FreeBSD: set network interface MTU to bridge MTU
authorGustau Perez <gustau.perez@gmail.com>
Mon, 20 Apr 2015 07:12:52 +0000 (09:12 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 22 Apr 2015 13:44:05 +0000 (14:44 +0100)
On creation time, tap and xnb interfaces are created with an mtu of
1500 bytes, assuming the bridge will have the same value.
Instead, check the bridge mtu and configure the new xnb or
tap interface with the same value.

The tools used are sed and ifconfig, both included on base. No need
to install additional ports (no new dependences).

Signed-off-by: Gustau Perez <gustau.perez@gmail.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.cmapbell@citrix.com>
[ ijc -- clarified title ]

tools/hotplug/FreeBSD/vif-bridge

index d350df4ce27d8fc16661e5274cf6725e044c22c9..062b20a8fa439d797326c1060a1d24ab2fdce7d7 100644 (file)
@@ -22,6 +22,8 @@ action=$2
 case $action in
 add)
        bridge=$(xenstore-read "$path/bridge")
+       mtu=$(ifconfig $bridge | sed -n 's/.*mtu \([0-9]*\)$/\1/p')
+       ifconfig $iface_dev mtu $mtu
        ifconfig $bridge addm $iface_dev
        ifconfig $iface_dev up
        exit 0