mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
netdev-linux: Add MTU check before setting MTU.
Following patch check if current MTU needs to be changed before issuing set-mtu ioctl. Suggested-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
@@ -1030,6 +1030,10 @@ netdev_linux_set_mtu(const struct netdev *netdev_, int mtu)
|
||||
struct ifreq ifr;
|
||||
int error;
|
||||
|
||||
if (netdev_dev->cache_valid & VALID_MTU &&
|
||||
netdev_dev->mtu == mtu) {
|
||||
return 0;
|
||||
}
|
||||
ifr.ifr_mtu = mtu;
|
||||
error = netdev_linux_do_ioctl(netdev_get_name(netdev_), &ifr,
|
||||
SIOCSIFMTU, "SIOCSIFMTU");
|
||||
|
Reference in New Issue
Block a user