runsc: Support retrieving MTU via netdevice ioctl.

This enables ifconfig to display MTU.

PiperOrigin-RevId: 216917021
Change-Id: Id513b23d9d76899bcb71b0b6a25036f41629a923
This commit is contained in:
Kevin Krakauer
2018-10-12 13:58:32 -07:00
committed by Shentubot
parent a771775f3a
commit 47d3862c33
+2 -1
View File
@@ -1266,9 +1266,10 @@ func interfaceIoctl(ctx context.Context, io usermem.IO, arg int, ifr *linux.IFRe
// Gets the metric of the device. As per netdevice(7), this
// always just sets ifr_metric to 0.
usermem.ByteOrder.PutUint32(ifr.Data[:4], 0)
case syscall.SIOCGIFMTU:
// Gets the MTU of the device.
// TODO: Implement.
usermem.ByteOrder.PutUint32(ifr.Data[:4], iface.MTU)
case syscall.SIOCGIFMAP:
// Gets the hardware parameters of the device.