projects
/
openvswitch
/ 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 19a80fbe14e1f4587c7aa615bd167a37b2b1faa2..49475360db0344bf834bd6847c9006a3280b7855 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");