|
@@ -1752,6 +1752,28 @@ int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(call_netdevice_notifiers);
|
|
EXPORT_SYMBOL(call_netdevice_notifiers);
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * call_netdevice_notifiers_mtu - call all network notifier blocks
|
|
|
|
+ * @val: value passed unmodified to notifier function
|
|
|
|
+ * @dev: net_device pointer passed unmodified to notifier function
|
|
|
|
+ * @arg: additional u32 argument passed to the notifier function
|
|
|
|
+ *
|
|
|
|
+ * Call all network notifier blocks. Parameters and return value
|
|
|
|
+ * are as for raw_notifier_call_chain().
|
|
|
|
+ */
|
|
|
|
+static int call_netdevice_notifiers_mtu(unsigned long val,
|
|
|
|
+ struct net_device *dev, u32 arg)
|
|
|
|
+{
|
|
|
|
+ struct netdev_notifier_info_ext info = {
|
|
|
|
+ .info.dev = dev,
|
|
|
|
+ .ext.mtu = arg,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ BUILD_BUG_ON(offsetof(struct netdev_notifier_info_ext, info) != 0);
|
|
|
|
+
|
|
|
|
+ return call_netdevice_notifiers_info(val, &info.info);
|
|
|
|
+}
|
|
|
|
+
|
|
#ifdef CONFIG_NET_INGRESS
|
|
#ifdef CONFIG_NET_INGRESS
|
|
static DEFINE_STATIC_KEY_FALSE(ingress_needed_key);
|
|
static DEFINE_STATIC_KEY_FALSE(ingress_needed_key);
|
|
|
|
|
|
@@ -7574,14 +7596,16 @@ int dev_set_mtu_ext(struct net_device *dev, int new_mtu,
|
|
err = __dev_set_mtu(dev, new_mtu);
|
|
err = __dev_set_mtu(dev, new_mtu);
|
|
|
|
|
|
if (!err) {
|
|
if (!err) {
|
|
- err = call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
|
|
|
|
|
|
+ err = call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev,
|
|
|
|
+ orig_mtu);
|
|
err = notifier_to_errno(err);
|
|
err = notifier_to_errno(err);
|
|
if (err) {
|
|
if (err) {
|
|
/* setting mtu back and notifying everyone again,
|
|
/* setting mtu back and notifying everyone again,
|
|
* so that they have a chance to revert changes.
|
|
* so that they have a chance to revert changes.
|
|
*/
|
|
*/
|
|
__dev_set_mtu(dev, orig_mtu);
|
|
__dev_set_mtu(dev, orig_mtu);
|
|
- call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
|
|
|
|
|
|
+ call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev,
|
|
|
|
+ new_mtu);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return err;
|
|
return err;
|