Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2008 10:43:08 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185366 - in head/sys: netinet netinet6 netipsec
Message-ID:  <200811271043.mARAh8jV084753@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Thu Nov 27 10:43:08 2008
New Revision: 185366
URL: http://svn.freebsd.org/changeset/base/185366

Log:
  Unify ipsec[46]_delete_pcbpolicy in ipsec_delete_pcbpolicy.
  Ignoring different names because of macros (in6pcb, in6p_sp) and
  inp vs. in6p variable name both functions were entirely identical.
  
  Reviewed by:	rwatson (as part of a larger changeset)
  MFC after:	6 weeks (*)
  (*) possibly need to leave a stub wrappers in 7 to keep the symbols.

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet6/in6_pcb.c
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/ipsec6.h

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Thu Nov 27 10:28:26 2008	(r185365)
+++ head/sys/netinet/in_pcb.c	Thu Nov 27 10:43:08 2008	(r185366)
@@ -899,7 +899,7 @@ in_pcbfree(struct inpcb *inp)
 	INP_WLOCK_ASSERT(inp);
 
 #ifdef IPSEC
-	ipsec4_delete_pcbpolicy(inp);
+	ipsec_delete_pcbpolicy(inp);
 #endif /* IPSEC */
 	inp->inp_gencnt = ++ipi->ipi_gencnt;
 	in_pcbremlists(inp);

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Thu Nov 27 10:28:26 2008	(r185365)
+++ head/sys/netinet/sctp_pcb.c	Thu Nov 27 10:43:08 2008	(r185366)
@@ -3408,7 +3408,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, 
 	cnt = 0;
 	if (so) {
 #ifdef IPSEC
-		ipsec4_delete_pcbpolicy(ip_pcb);
+		ipsec_delete_pcbpolicy(ip_pcb);
 #endif				/* IPSEC */
 
 		/* Unlocks not needed since the socket is gone now */

Modified: head/sys/netinet6/in6_pcb.c
==============================================================================
--- head/sys/netinet6/in6_pcb.c	Thu Nov 27 10:28:26 2008	(r185365)
+++ head/sys/netinet6/in6_pcb.c	Thu Nov 27 10:43:08 2008	(r185366)
@@ -422,7 +422,7 @@ in6_pcbfree(struct inpcb *inp)
 
 #ifdef IPSEC
 	if (inp->in6p_sp != NULL)
-		ipsec6_delete_pcbpolicy(inp);
+		ipsec_delete_pcbpolicy(inp);
 #endif /* IPSEC */
 	inp->inp_gencnt = ++ipi->ipi_gencnt;
 	in_pcbremlists(inp);

Modified: head/sys/netipsec/ipsec.c
==============================================================================
--- head/sys/netipsec/ipsec.c	Thu Nov 27 10:28:26 2008	(r185365)
+++ head/sys/netipsec/ipsec.c	Thu Nov 27 10:43:08 2008	(r185366)
@@ -1216,7 +1216,7 @@ ipsec4_get_policy(inp, request, len, mp)
 
 /* delete policy in PCB */
 int
-ipsec4_delete_pcbpolicy(inp)
+ipsec_delete_pcbpolicy(inp)
 	struct inpcb *inp;
 {
 	IPSEC_ASSERT(inp != NULL, ("null inp"));
@@ -1308,27 +1308,6 @@ ipsec6_get_policy(in6p, request, len, mp
 
 	return ipsec_get_policy(pcb_sp, mp);
 }
-
-int
-ipsec6_delete_pcbpolicy(in6p)
-	struct in6pcb *in6p;
-{
-	IPSEC_ASSERT(in6p != NULL, ("null in6p"));
-
-	if (in6p->in6p_sp == NULL)
-		return 0;
-
-	if (in6p->in6p_sp->sp_in != NULL)
-		KEY_FREESP(&in6p->in6p_sp->sp_in);
-
-	if (in6p->in6p_sp->sp_out != NULL)
-		KEY_FREESP(&in6p->in6p_sp->sp_out);
-
-	ipsec_delpcbpolicy(in6p->in6p_sp);
-	in6p->in6p_sp = NULL;
-
-	return 0;
-}
 #endif
 
 /*

Modified: head/sys/netipsec/ipsec.h
==============================================================================
--- head/sys/netipsec/ipsec.h	Thu Nov 27 10:28:26 2008	(r185365)
+++ head/sys/netipsec/ipsec.h	Thu Nov 27 10:43:08 2008	(r185366)
@@ -380,7 +380,7 @@ extern int ipsec4_set_policy __P((struct
 	caddr_t request, size_t len, struct ucred *cred));
 extern int ipsec4_get_policy __P((struct inpcb *inpcb, caddr_t request,
 	size_t len, struct mbuf **mp));
-extern int ipsec4_delete_pcbpolicy __P((struct inpcb *));
+extern int ipsec_delete_pcbpolicy __P((struct inpcb *));
 extern int ipsec4_in_reject __P((struct mbuf *, struct inpcb *));
 
 struct secas;

Modified: head/sys/netipsec/ipsec6.h
==============================================================================
--- head/sys/netipsec/ipsec6.h	Thu Nov 27 10:28:26 2008	(r185365)
+++ head/sys/netipsec/ipsec6.h	Thu Nov 27 10:43:08 2008	(r185366)
@@ -50,7 +50,6 @@ extern int ip6_ipsec_ecn;
 
 struct inpcb;
 
-extern int ipsec6_delete_pcbpolicy __P((struct inpcb *));
 extern int ipsec6_set_policy __P((struct inpcb *inp, int optname,
 	caddr_t request, size_t len, struct ucred *cred));
 extern int ipsec6_get_policy



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