hotplug/FreeBSD: set network interface MTU to bridge MTU

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 ]
This commit is contained in:
Gustau Perez authored and Ian Campbell committed 2015-04-22 14:44:05 +01:00
1 parent 940d148dfc
commit 1d5614db07
1 file changed
+2
+2
View 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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.