svn commit: r187626 - user/dfr/xenhvm/6/sys/dev/xen/netfront
Doug Rabson
dfr at FreeBSD.org
Fri Jan 23 03:11:30 PST 2009
Author: dfr
Date: Fri Jan 23 11:11:29 2009
New Revision: 187626
URL: http://svn.freebsd.org/changeset/base/187626
Log:
Send an ARP packet on resume. This helps switches to learn the new location
of the VM after a live migration.
Modified:
user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c
Modified: user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c
==============================================================================
--- user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c Fri Jan 23 08:37:26 2009 (r187625)
+++ user/dfr/xenhvm/6/sys/dev/xen/netfront/netfront.c Fri Jan 23 11:11:29 2009 (r187626)
@@ -591,6 +591,24 @@ setup_device(device_t dev, struct netfro
}
/**
+ * If this interface has an ipv4 address, send an arp for it. This
+ * helps to get the network going again after migrating hosts.
+ */
+static void
+netfront_send_fake_arp(device_t dev, struct netfront_info *info)
+{
+ struct ifnet *ifp;
+ struct ifaddr *ifa;
+
+ ifp = info->xn_ifp;
+ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ if (ifa->ifa_addr->sa_family == AF_INET) {
+ arp_ifinit(ifp, ifa);
+ }
+ }
+}
+
+/**
* Callback received when the backend's state changes.
*/
static void
@@ -615,9 +633,7 @@ netfront_backend_changed(device_t dev, X
if (network_connect(sc) != 0)
break;
xenbus_set_state(dev, XenbusStateConnected);
-#ifdef notyet
- (void)send_fake_arp(netdev);
-#endif
+ netfront_send_fake_arp(dev, sc);
break;
case XenbusStateClosing:
xenbus_set_state(dev, XenbusStateClosed);
More information about the svn-src-user
mailing list