From 1c082e2bd7e437a7d8cd65c0d9519667db551bfd Mon Sep 17 00:00:00 2001 From: bz Date: Fri, 7 Sep 2012 09:22:11 +0000 Subject: [PATCH] MFC r238877-238878: Fix a comment that we do not have an SA yet but need to acquire one. For consistency put the IPsec comment iside the #fidef section. MFC r238934 Improve the should-never-hit printf to ease debugging in case we'd ever hit it again when doing the delayed IPv6 checksum calculations. Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.1@240193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/netinet6/ip6_ipsec.c | 2 +- sys/netinet6/ip6_output.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c index 234874a5..ac9515ae 100644 --- a/sys/netinet6/ip6_ipsec.c +++ b/sys/netinet6/ip6_ipsec.c @@ -263,7 +263,7 @@ ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error, mtag->m_tag_id != PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED) continue; /* - * Check if policy has an SA associated with it. + * Check if policy has no SA associated with it. * This can happen when an SP has yet to acquire * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index df4e1b0b..a91066d9 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -195,8 +195,9 @@ in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) offset += m->m_pkthdr.csum_data; /* checksum offset */ if (offset + sizeof(u_short) > m->m_len) { - printf("%s: delayed m_pullup, m->len: %d off: %d\n", - __func__, m->m_len, offset); + printf("%s: delayed m_pullup, m->len: %d plen %u off %u " + "csum_flags=0x%04x\n", __func__, m->m_len, plen, offset, + m->m_pkthdr.csum_flags); /* * XXX this should not happen, but if it does, the correct * behavior may be to insert the checksum in the appropriate @@ -292,11 +293,11 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, MAKE_EXTHDR(opt->ip6po_dest2, &exthdrs.ip6e_dest2); } +#ifdef IPSEC /* * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ -#ifdef IPSEC switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) { case 1: /* Bad packet */ -- 2.42.0