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.
This commit is contained in:
bz 2008-11-27 10:43:08 +00:00
parent e10155204b
commit 9ef49d8b6f
6 changed files with 5 additions and 27 deletions

View File

@ -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);

View File

@ -3408,7 +3408,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
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 */

View File

@ -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);

View File

@ -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
/*

View File

@ -380,7 +380,7 @@ extern int ipsec4_set_policy __P((struct inpcb *inp, int optname,
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;

View File

@ -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