]> git.baikalelectronics.ru Git - kernel.git/commit
net: make dev_set_mtu() honor notification return code
authorVeaceslav Falico <vfalico@redhat.com>
Fri, 10 Jan 2014 15:56:25 +0000 (16:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Jan 2014 23:19:26 +0000 (15:19 -0800)
commit524cf2bed9597ec1dbdc72f1d7ba9b6ecc155114
tree751234af7ab27daebdf18cb4b08ef8247cabb52e
parentc600c52b5af46c53c35a2746d970d82b5aa31bff
net: make dev_set_mtu() honor notification return code

Currently, after changing the MTU for a device, dev_set_mtu() calls
NETDEV_CHANGEMTU notification, however doesn't verify it's return code -
which can be NOTIFY_BAD - i.e. some of the net notifier blocks refused this
change, and continues nevertheless.

To fix this, verify the return code, and if it's an error - then revert the
MTU to the original one, notify again and pass the error code.

CC: Jiri Pirko <jiri@resnulli.us>
CC: "David S. Miller" <davem@davemloft.net>
CC: Eric Dumazet <edumazet@google.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c