svn commit: r344061 - head/sys/netinet

Kristof Provost kp at FreeBSD.org
Tue Feb 12 21:22:58 UTC 2019


Author: kp
Date: Tue Feb 12 21:22:57 2019
New Revision: 344061
URL: https://svnweb.freebsd.org/changeset/base/344061

Log:
  garp: Fix vnet related panic for gratuitous arp
  
  Gratuitous ARP packets are sent from a timer, which means we don't have a vnet
  context set. As a result we panic trying to send the packet.
  
  Set the vnet context based on the interface associated with the interface
  address.
  
  To reproduce:
    sysctl net.link.ether.inet.garp_rexmit_count=2
    ifconfig vtnet1 10.0.0.1/24 up
  
  PR:		235699
  Reviewed by:	vangyzen@
  MFC after:	1 week

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Tue Feb 12 21:08:44 2019	(r344060)
+++ head/sys/netinet/if_ether.c	Tue Feb 12 21:22:57 2019	(r344061)
@@ -1335,6 +1335,8 @@ garp_rexmit(void *arg)
 		return;
 	}
 
+	CURVNET_SET(ia->ia_ifa.ifa_ifp->if_vnet);
+
 	/*
 	 * Drop lock while the ARP request is generated.
 	 */
@@ -1362,6 +1364,8 @@ garp_rexmit(void *arg)
 			ifa_free(&ia->ia_ifa);
 		}
 	}
+
+	CURVNET_RESTORE();
 }
 
 /*


More information about the svn-src-all mailing list