mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 16:01:05 +08:00
Update to FreeBSD head 2017-08-01
Git mirror commit f5002f5e5f78cae9f0269d812dc0aedb0339312c. Update #3472.
This commit is contained in:
@@ -183,7 +183,8 @@ next:
|
||||
* IPsec output logic for IPv4.
|
||||
*/
|
||||
static int
|
||||
ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx)
|
||||
ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp,
|
||||
struct inpcb *inp, u_int idx)
|
||||
{
|
||||
struct ipsec_ctx_data ctx;
|
||||
union sockaddr_union *dst;
|
||||
@@ -213,7 +214,7 @@ ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx)
|
||||
/*
|
||||
* XXXAE: most likely ip_sum at this point is wrong.
|
||||
*/
|
||||
IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET, IPSEC_ENC_BEFORE);
|
||||
IPSEC_INIT_CTX(&ctx, &m, inp, sav, AF_INET, IPSEC_ENC_BEFORE);
|
||||
if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
|
||||
goto bad;
|
||||
|
||||
@@ -237,9 +238,10 @@ ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx)
|
||||
/* XXXAE: IPSEC_OSTAT_INC(tunnel); */
|
||||
goto bad;
|
||||
}
|
||||
inp = NULL;
|
||||
}
|
||||
|
||||
IPSEC_INIT_CTX(&ctx, &m, sav, dst->sa.sa_family, IPSEC_ENC_AFTER);
|
||||
IPSEC_INIT_CTX(&ctx, &m, inp, sav, dst->sa.sa_family, IPSEC_ENC_AFTER);
|
||||
if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
|
||||
goto bad;
|
||||
|
||||
@@ -287,7 +289,7 @@ ipsec4_process_packet(struct mbuf *m, struct secpolicy *sp,
|
||||
struct inpcb *inp)
|
||||
{
|
||||
|
||||
return (ipsec4_perform_request(m, sp, 0));
|
||||
return (ipsec4_perform_request(m, sp, inp, 0));
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -493,7 +495,8 @@ next:
|
||||
* IPsec output logic for IPv6.
|
||||
*/
|
||||
static int
|
||||
ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx)
|
||||
ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp,
|
||||
struct inpcb *inp, u_int idx)
|
||||
{
|
||||
struct ipsec_ctx_data ctx;
|
||||
union sockaddr_union *dst;
|
||||
@@ -516,7 +519,7 @@ ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx)
|
||||
ip6 = mtod(m, struct ip6_hdr *);
|
||||
ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6));
|
||||
|
||||
IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET6, IPSEC_ENC_BEFORE);
|
||||
IPSEC_INIT_CTX(&ctx, &m, inp, sav, AF_INET6, IPSEC_ENC_BEFORE);
|
||||
if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
|
||||
goto bad;
|
||||
|
||||
@@ -542,9 +545,10 @@ ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx)
|
||||
/* XXXAE: IPSEC_OSTAT_INC(tunnel); */
|
||||
goto bad;
|
||||
}
|
||||
inp = NULL;
|
||||
}
|
||||
|
||||
IPSEC_INIT_CTX(&ctx, &m, sav, dst->sa.sa_family, IPSEC_ENC_AFTER);
|
||||
IPSEC_INIT_CTX(&ctx, &m, inp, sav, dst->sa.sa_family, IPSEC_ENC_AFTER);
|
||||
if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
|
||||
goto bad;
|
||||
|
||||
@@ -587,7 +591,7 @@ ipsec6_process_packet(struct mbuf *m, struct secpolicy *sp,
|
||||
struct inpcb *inp)
|
||||
{
|
||||
|
||||
return (ipsec6_perform_request(m, sp, 0));
|
||||
return (ipsec6_perform_request(m, sp, inp, 0));
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -752,14 +756,14 @@ ipsec_process_done(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav,
|
||||
case AF_INET:
|
||||
key_freesav(&sav);
|
||||
IPSECSTAT_INC(ips_out_bundlesa);
|
||||
return (ipsec4_perform_request(m, sp, idx));
|
||||
return (ipsec4_perform_request(m, sp, NULL, idx));
|
||||
/* NOTREACHED */
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
key_freesav(&sav);
|
||||
IPSEC6STAT_INC(ips_out_bundlesa);
|
||||
return (ipsec6_perform_request(m, sp, idx));
|
||||
return (ipsec6_perform_request(m, sp, NULL, idx));
|
||||
/* NOTREACHED */
|
||||
#endif /* INET6 */
|
||||
default:
|
||||
|
Reference in New Issue
Block a user