git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe4a02e
)
netdev-linux: Add MTU check before setting MTU.
author
Pravin B Shelar
<pshelar@nicira.com>
Wed, 25 Jan 2012 23:44:26 +0000
(15:44 -0800)
committer
Pravin B Shelar
<pshelar@nicira.com>
Wed, 25 Jan 2012 23:44:26 +0000
(15:44 -0800)
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>
lib/netdev-linux.c
patch
|
blob
|
history
diff --git
a/lib/netdev-linux.c
b/lib/netdev-linux.c
index
19a80fb
..
4947536
100644
(file)
--- a/
lib/netdev-linux.c
+++ b/
lib/netdev-linux.c
@@
-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");