Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Feb 2019 15:46:05 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344103 - head/sys/netinet
Message-ID:  <201902131546.x1DFk5gZ077957@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Feb 13 15:46:05 2019
New Revision: 344103
URL: https://svnweb.freebsd.org/changeset/base/344103

Log:
  In r335015 PCB destroing was made deferred using epoch_call().
  
  But ipsec_delete_pcbpolicy() uses some VNET-virtualized variables,
  and thus it needs VNET context, that is missing during gtaskqueue
  executing. Use inp_vnet context to set curvnet in in_pcbfree_deferred().
  
  PR:		235684
  MFC after:	1 week

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Wed Feb 13 15:30:06 2019	(r344102)
+++ head/sys/netinet/in_pcb.c	Wed Feb 13 15:46:05 2019	(r344103)
@@ -1565,6 +1565,7 @@ in_pcbfree_deferred(epoch_context_t ctx)
 	inp = __containerof(ctx, struct inpcb, inp_epoch_ctx);
 
 	INP_WLOCK(inp);
+	CURVNET_SET(inp->inp_vnet);
 #ifdef INET
 	struct ip_moptions *imo = inp->inp_moptions;
 	inp->inp_moptions = NULL;
@@ -1597,6 +1598,7 @@ in_pcbfree_deferred(epoch_context_t ctx)
 #ifdef INET
 	inp_freemoptions(imo);
 #endif	
+	CURVNET_RESTORE();
 }
 
 /*



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