Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2019 18:22:57 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r344282 - stable/11/sys/netinet
Message-ID:  <201902191822.x1JIMv5E015414@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Tue Feb 19 18:22:57 2019
New Revision: 344282
URL: https://svnweb.freebsd.org/changeset/base/344282

Log:
  MFC r344061:
  
  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@

Modified:
  stable/11/sys/netinet/if_ether.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/if_ether.c
==============================================================================
--- stable/11/sys/netinet/if_ether.c	Tue Feb 19 18:22:55 2019	(r344281)
+++ stable/11/sys/netinet/if_ether.c	Tue Feb 19 18:22:57 2019	(r344282)
@@ -1351,6 +1351,8 @@ garp_rexmit(void *arg)
 		return;
 	}
 
+	CURVNET_SET(ia->ia_ifa.ifa_ifp->if_vnet);
+
 	/*
 	 * Drop lock while the ARP request is generated.
 	 */
@@ -1378,6 +1380,8 @@ garp_rexmit(void *arg)
 			ifa_free(&ia->ia_ifa);
 		}
 	}
+
+	CURVNET_RESTORE();
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902191822.x1JIMv5E015414>