diff options
-rw-r--r-- | include/linux/netdevice.h | 15 | ||||
-rw-r--r-- | net/core/dev.c | 20 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 1 |
3 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1347ac50d2af..ce784d5018e0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <linux/netdev_features.h> | 51 | #include <linux/netdev_features.h> |
52 | #include <linux/neighbour.h> | 52 | #include <linux/neighbour.h> |
53 | #include <uapi/linux/netdevice.h> | 53 | #include <uapi/linux/netdevice.h> |
54 | #include <uapi/linux/if_bonding.h> | ||
54 | 55 | ||
55 | struct netpoll_info; | 56 | struct netpoll_info; |
56 | struct device; | 57 | struct device; |
@@ -2056,6 +2057,7 @@ struct pcpu_sw_netstats { | |||
2056 | #define NETDEV_RESEND_IGMP 0x0016 | 2057 | #define NETDEV_RESEND_IGMP 0x0016 |
2057 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ | 2058 | #define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */ |
2058 | #define NETDEV_CHANGEINFODATA 0x0018 | 2059 | #define NETDEV_CHANGEINFODATA 0x0018 |
2060 | #define NETDEV_BONDING_INFO 0x0019 | ||
2059 | 2061 | ||
2060 | int register_netdevice_notifier(struct notifier_block *nb); | 2062 | int register_netdevice_notifier(struct notifier_block *nb); |
2061 | int unregister_netdevice_notifier(struct notifier_block *nb); | 2063 | int unregister_netdevice_notifier(struct notifier_block *nb); |
@@ -3494,6 +3496,19 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb, | |||
3494 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, | 3496 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, |
3495 | netdev_features_t features); | 3497 | netdev_features_t features); |
3496 | 3498 | ||
3499 | struct netdev_bonding_info { | ||
3500 | ifslave slave; | ||
3501 | ifbond master; | ||
3502 | }; | ||
3503 | |||
3504 | struct netdev_notifier_bonding_info { | ||
3505 | struct netdev_notifier_info info; /* must be first */ | ||
3506 | struct netdev_bonding_info bonding_info; | ||
3507 | }; | ||
3508 | |||
3509 | void netdev_bonding_info_change(struct net_device *dev, | ||
3510 | struct netdev_bonding_info *bonding_info); | ||
3511 | |||
3497 | static inline | 3512 | static inline |
3498 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) | 3513 | struct sk_buff *skb_gso_segment(struct sk_buff *skb, netdev_features_t features) |
3499 | { | 3514 | { |
diff --git a/net/core/dev.c b/net/core/dev.c index 1d564d68e31a..ede0b161b115 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -5355,6 +5355,26 @@ void netdev_upper_dev_unlink(struct net_device *dev, | |||
5355 | } | 5355 | } |
5356 | EXPORT_SYMBOL(netdev_upper_dev_unlink); | 5356 | EXPORT_SYMBOL(netdev_upper_dev_unlink); |
5357 | 5357 | ||
5358 | /** | ||
5359 | * netdev_bonding_info_change - Dispatch event about slave change | ||
5360 | * @dev: device | ||
5361 | * @netdev_bonding_info: info to dispatch | ||
5362 | * | ||
5363 | * Send NETDEV_BONDING_INFO to netdev notifiers with info. | ||
5364 | * The caller must hold the RTNL lock. | ||
5365 | */ | ||
5366 | void netdev_bonding_info_change(struct net_device *dev, | ||
5367 | struct netdev_bonding_info *bonding_info) | ||
5368 | { | ||
5369 | struct netdev_notifier_bonding_info info; | ||
5370 | |||
5371 | memcpy(&info.bonding_info, bonding_info, | ||
5372 | sizeof(struct netdev_bonding_info)); | ||
5373 | call_netdevice_notifiers_info(NETDEV_BONDING_INFO, dev, | ||
5374 | &info.info); | ||
5375 | } | ||
5376 | EXPORT_SYMBOL(netdev_bonding_info_change); | ||
5377 | |||
5358 | void netdev_adjacent_add_links(struct net_device *dev) | 5378 | void netdev_adjacent_add_links(struct net_device *dev) |
5359 | { | 5379 | { |
5360 | struct netdev_adjacent *iter; | 5380 | struct netdev_adjacent *iter; |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 673cb4c6f391..4cd5e350d129 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -3180,6 +3180,7 @@ static int rtnetlink_event(struct notifier_block *this, unsigned long event, voi | |||
3180 | case NETDEV_UNREGISTER_FINAL: | 3180 | case NETDEV_UNREGISTER_FINAL: |
3181 | case NETDEV_RELEASE: | 3181 | case NETDEV_RELEASE: |
3182 | case NETDEV_JOIN: | 3182 | case NETDEV_JOIN: |
3183 | case NETDEV_BONDING_INFO: | ||
3183 | break; | 3184 | break; |
3184 | default: | 3185 | default: |
3185 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL); | 3186 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL); |