mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
940d148dfc
commit
1d5614db07
1 file changed
+2
@@ -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
|
||||
|
||||