aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/notifier.h1
-rw-r--r--net/ipv4/devinet.c1
-rw-r--r--net/sched/sch_generic.c18
4 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 40291f37502..a24916156f4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1772,6 +1772,8 @@ extern void netif_carrier_on(struct net_device *dev);
1772 1772
1773extern void netif_carrier_off(struct net_device *dev); 1773extern void netif_carrier_off(struct net_device *dev);
1774 1774
1775extern void netif_notify_peers(struct net_device *dev);
1776
1775/** 1777/**
1776 * netif_dormant_on - mark device as dormant. 1778 * netif_dormant_on - mark device as dormant.
1777 * @dev: network device 1779 * @dev: network device
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 540703b555c..22c2abb6197 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -210,6 +210,7 @@ static inline int notifier_to_errno(int ret)
210#define NETDEV_POST_INIT 0x0010 210#define NETDEV_POST_INIT 0x0010
211#define NETDEV_UNREGISTER_BATCH 0x0011 211#define NETDEV_UNREGISTER_BATCH 0x0011
212#define NETDEV_BONDING_DESLAVE 0x0012 212#define NETDEV_BONDING_DESLAVE 0x0012
213#define NETDEV_NOTIFY_PEERS 0x0012
213 214
214#define SYS_DOWN 0x0001 /* Notify of system down */ 215#define SYS_DOWN 0x0001 /* Notify of system down */
215#define SYS_RESTART SYS_DOWN 216#define SYS_RESTART SYS_DOWN
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 382bc768ed5..da14c49284f 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1081,6 +1081,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
1081 } 1081 }
1082 ip_mc_up(in_dev); 1082 ip_mc_up(in_dev);
1083 /* fall through */ 1083 /* fall through */
1084 case NETDEV_NOTIFY_PEERS:
1084 case NETDEV_CHANGEADDR: 1085 case NETDEV_CHANGEADDR:
1085 /* Send gratuitous ARP to notify of link change */ 1086 /* Send gratuitous ARP to notify of link change */
1086 if (IN_DEV_ARP_NOTIFY(in_dev)) { 1087 if (IN_DEV_ARP_NOTIFY(in_dev)) {
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index a63029ef3ed..bd1892fe4b2 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -327,6 +327,24 @@ void netif_carrier_off(struct net_device *dev)
327} 327}
328EXPORT_SYMBOL(netif_carrier_off); 328EXPORT_SYMBOL(netif_carrier_off);
329 329
330/**
331 * netif_notify_peers - notify network peers about existence of @dev
332 * @dev: network device
333 *
334 * Generate traffic such that interested network peers are aware of
335 * @dev, such as by generating a gratuitous ARP. This may be used when
336 * a device wants to inform the rest of the network about some sort of
337 * reconfiguration such as a failover event or virtual machine
338 * migration.
339 */
340void netif_notify_peers(struct net_device *dev)
341{
342 rtnl_lock();
343 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
344 rtnl_unlock();
345}
346EXPORT_SYMBOL(netif_notify_peers);
347
330/* "NOOP" scheduler: the best scheduler, recommended for all interfaces 348/* "NOOP" scheduler: the best scheduler, recommended for all interfaces
331 under all circumstances. It is difficult to invent anything faster or 349 under all circumstances. It is difficult to invent anything faster or
332 cheaper. 350 cheaper.