I'm auditing code related to pr_input() to take them outside of the KERNEL_LOCK(). It's hard because many DPRINTF() statements include the name of the function they are in. Diff below convert most of them to "%s" + __func__.
ok? Index: netinet/ip_ah.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_ah.c,v retrieving revision 1.131 diff -u -p -r1.131 ip_ah.c --- netinet/ip_ah.c 11 Aug 2017 21:24:19 -0000 1.131 +++ netinet/ip_ah.c 6 Nov 2017 12:35:56 -0000 @@ -130,7 +130,8 @@ ah_init(struct tdb *tdbp, struct xformsw break; default: - DPRINTF(("ah_init(): unsupported authentication algorithm %d specified\n", ii->ii_authalg)); + DPRINTF(("%s: unsupported authentication algorithm %d" + " specified\n", __func__, ii->ii_authalg)); return EINVAL; } @@ -145,7 +146,7 @@ ah_init(struct tdb *tdbp, struct xformsw tdbp->tdb_authalgxform = thash; tdbp->tdb_rpl = AH_HMAC_INITIAL_RPL; - DPRINTF(("ah_init(): initialized TDB with hash algorithm %s\n", + DPRINTF(("%s: initialized TDB with hash algorithm %s\n", __func__, thash->name)); tdbp->tdb_amxkeylen = ii->ii_authkeylen; @@ -214,7 +215,7 @@ ah_massage_headers(struct mbuf **m0, int */ *m0 = m = m_pullup(m, skip); if (m == NULL) { - DPRINTF(("ah_massage_headers(): m_pullup() failed\n")); + DPRINTF(("%s: m_pullup() failed\n", __func__)); ahstat.ahs_hdrops++; return ENOBUFS; } @@ -234,9 +235,8 @@ ah_massage_headers(struct mbuf **m0, int off + 1 < skip) ; else { - DPRINTF(("ah_massage_headers(): illegal IPv4 " - "option length for option %d\n", - ptr[off])); + DPRINTF(("%s: illegal IPv4 option length for" + " option %d\n", __func__, ptr[off])); ahstat.ahs_hdrops++; m_freem(m); @@ -259,9 +259,9 @@ ah_massage_headers(struct mbuf **m0, int case 0x95: /* RFC1770 */ /* Sanity check for option length. */ if (ptr[off + 1] < 2) { - DPRINTF(("ah_massage_headers(): " - "illegal IPv4 option length for " - "option %d\n", ptr[off])); + DPRINTF(("%s: illegal IPv4 option" + " length for option %d\n", __func__, + ptr[off])); ahstat.ahs_hdrops++; m_freem(m); @@ -275,9 +275,9 @@ ah_massage_headers(struct mbuf **m0, int case IPOPT_SSRR: /* Sanity check for option length. */ if (ptr[off + 1] < 2) { - DPRINTF(("ah_massage_headers(): " - "illegal IPv4 option length for " - "option %d\n", ptr[off])); + DPRINTF(("%s: illegal IPv4 option" + " length for option %d\n", __func__, + ptr[off])); ahstat.ahs_hdrops++; m_freem(m); @@ -302,9 +302,9 @@ ah_massage_headers(struct mbuf **m0, int default: /* Sanity check for option length. */ if (ptr[off + 1] < 2) { - DPRINTF(("ah_massage_headers(): " - "illegal IPv4 option length for " - "option %d\n", ptr[off])); + DPRINTF(("%s: illegal IPv4 option" + " length for option %d\n", __func__, + ptr[off])); ahstat.ahs_hdrops++; m_freem(m); return EINVAL; @@ -319,8 +319,8 @@ ah_massage_headers(struct mbuf **m0, int /* Sanity check. */ if (off > skip) { - DPRINTF(("ah_massage_headers(): malformed " - "IPv4 options header\n")); + DPRINTF(("%s: malformed IPv4 options header\n", + __func__)); ahstat.ahs_hdrops++; m_freem(m); @@ -337,8 +337,7 @@ ah_massage_headers(struct mbuf **m0, int /* We don't do IPv6 Jumbograms. */ if (ip6.ip6_plen == 0) { - DPRINTF(("ah_massage_headers(): unsupported IPv6 " - "jumbogram")); + DPRINTF(("%s: unsupported IPv6 jumbogram", __func__)); ahstat.ahs_hdrops++; m_freem(m); return EMSGSIZE; @@ -364,7 +363,8 @@ ah_massage_headers(struct mbuf **m0, int ptr = malloc(skip - sizeof(struct ip6_hdr), M_XDATA, M_NOWAIT); if (ptr == NULL) { - DPRINTF(("ah_massage_headers(): failed to allocate memory for IPv6 headers\n")); + DPRINTF(("%s: failed to allocate memory" + " for IPv6 headers\n", __func__)); ahstat.ahs_hdrops++; m_freem(m); return ENOBUFS; @@ -496,8 +496,8 @@ ah_massage_headers(struct mbuf **m0, int } default: - DPRINTF(("ah_massage_headers(): unexpected " - "IPv6 header type %d\n", off)); + DPRINTF(("%s: unexpected IPv6 header type %d\n", + __func__, off)); if (alloc) free(ptr, M_XDATA, 0); ahstat.ahs_hdrops++; @@ -556,29 +556,30 @@ ah_input(struct mbuf *m, struct tdb *tdb break; case 1: m_freem(m); - DPRINTF(("ah_input(): replay counter wrapped for " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: replay counter wrapped for SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_wrap++; return ENOBUFS; case 2: m_freem(m); - DPRINTF(("ah_input(): old packet received in " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: old packet received in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_replay++; return ENOBUFS; case 3: m_freem(m); - DPRINTF(("ah_input(): duplicate packet received in " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: duplicate packet received in SA " + "%s/%08x\n", __func__, + ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_replay++; return ENOBUFS; default: m_freem(m); - DPRINTF(("ah_input(): bogus value from " - "checkreplaywindow() in SA %s/%08x\n", + DPRINTF(("%s: bogus value from " + "checkreplaywindow() in SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_replay++; @@ -588,8 +589,8 @@ ah_input(struct mbuf *m, struct tdb *tdb /* Verify AH header length. */ if (hl * sizeof(u_int32_t) != ahx->authsize + rplen - AH_FLENGTH) { - DPRINTF(("ah_input(): bad authenticator length %ld for packet " - "in SA %s/%08x\n", hl * sizeof(u_int32_t), + DPRINTF(("%s: bad authenticator length %ld for packet " + "in SA %s/%08x\n", __func__, hl * sizeof(u_int32_t), ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); @@ -623,8 +624,8 @@ ah_input(struct mbuf *m, struct tdb *tdb crp = crypto_getreq(1); if (crp == NULL) { m_freem(m); - DPRINTF(("ah_input(): failed to acquire crypto " - "descriptors\n")); + DPRINTF(("%s: failed to acquire crypto descriptors\n", + __func__)); ahstat.ahs_crypto++; return ENOBUFS; } @@ -652,7 +653,7 @@ ah_input(struct mbuf *m, struct tdb *tdb if (tc == NULL) { m_freem(m); crypto_freereq(crp); - DPRINTF(("ah_input(): failed to allocate tdb_crypto\n")); + DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); ahstat.ahs_crypto++; return ENOBUFS; } @@ -722,8 +723,7 @@ ah_input_cb(struct cryptop *crp) free(tc, M_XDATA, 0); crypto_freereq(crp); ahstat.ahs_crypto++; - DPRINTF(("ah_input_cb(): bogus returned buffer from " - "crypto\n")); + DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); return; } @@ -733,7 +733,7 @@ ah_input_cb(struct cryptop *crp) if (tdb == NULL) { free(tc, M_XDATA, 0); ahstat.ahs_notdb++; - DPRINTF(("ah_input_cb(): TDB is expired while in crypto")); + DPRINTF(("%s: TDB is expired while in crypto", __func__)); goto baddone; } @@ -751,7 +751,7 @@ ah_input_cb(struct cryptop *crp) } free(tc, M_XDATA, 0); ahstat.ahs_noxform++; - DPRINTF(("ah_input_cb(): crypto error %d\n", crp->crp_etype)); + DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); goto baddone; } else { crypto_freereq(crp); /* No longer needed. */ @@ -769,9 +769,8 @@ ah_input_cb(struct cryptop *crp) if (timingsafe_bcmp(ptr + skip + rplen, calc, ahx->authsize)) { free(tc, M_XDATA, 0); - DPRINTF(("ah_input(): authentication failed for " - "packet in SA %s/%08x\n", - ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), + DPRINTF(("%s: authentication failed for packet in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_badauth++; @@ -799,26 +798,27 @@ ah_input_cb(struct cryptop *crp) #endif break; case 1: - DPRINTF(("ah_input(): replay counter wrapped for " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: replay counter wrapped for SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_wrap++; goto baddone; case 2: - DPRINTF(("ah_input_cb(): old packet received in " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: old packet received in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_replay++; goto baddone; case 3: - DPRINTF(("ah_input_cb(): duplicate packet received in " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s): duplicate packet received in " + "SA %s/%08x\n", __func__, + ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_replay++; goto baddone; default: - DPRINTF(("ah_input_cb(): bogus value from " - "checkreplaywindow() in SA %s/%08x\n", + DPRINTF(("%s: bogus value from " + "checkreplaywindow() in SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ahstat.ahs_replay++; @@ -833,8 +833,8 @@ ah_input_cb(struct cryptop *crp) NET_UNLOCK(); m_freem(m); - DPRINTF(("ah_input(): bad mbuf chain for packet in SA " - "%s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), + DPRINTF(("%s: bad mbuf chain for packet in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); return; } @@ -958,7 +958,7 @@ ah_output(struct mbuf *m, struct tdb *td * manual) keying. */ if ((tdb->tdb_rpl == 0) && (tdb->tdb_wnd > 0)) { - DPRINTF(("ah_output(): SA %s/%08x should have expired\n", + DPRINTF(("%s: SA %s/%08x should have expired\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -972,8 +972,8 @@ ah_output(struct mbuf *m, struct tdb *td case AF_INET: /* Check for IP maximum packet size violations. */ if (rplen + ahx->authsize + m->m_pkthdr.len > IP_MAXPACKET) { - DPRINTF(("ah_output(): packet in SA %s/%08x got too " - "big\n", + DPRINTF(("%s: packet in SA %s/%08x got too big\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -986,8 +986,8 @@ ah_output(struct mbuf *m, struct tdb *td case AF_INET6: /* Check for IPv6 maximum packet size violations. */ if (rplen + ahx->authsize + m->m_pkthdr.len > IPV6_MAXPACKET) { - DPRINTF(("ah_output(): packet in SA %s/%08x " - "got too big\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: packet in SA %s/%08x got too big\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); ahstat.ahs_toobig++; @@ -997,8 +997,8 @@ ah_output(struct mbuf *m, struct tdb *td #endif /* INET6 */ default: - DPRINTF(("ah_output(): unknown/unsupported protocol " - "family %d, SA %s/%08x\n", tdb->tdb_dst.sa.sa_family, + DPRINTF(("%s: unknown/unsupported protocol family %d, " + "SA %s/%08x\n", __func__, tdb->tdb_dst.sa.sa_family, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -1050,8 +1050,8 @@ ah_output(struct mbuf *m, struct tdb *td /* Inject AH header. */ mi = m_makespace(m, skip, rplen + ahx->authsize, &roff); if (mi == NULL) { - DPRINTF(("ah_output(): failed to inject AH header for SA " - "%s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), + DPRINTF(("%s: failed to inject AH header for SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -1084,8 +1084,8 @@ ah_output(struct mbuf *m, struct tdb *td crp = crypto_getreq(1); if (crp == NULL) { m_freem(m); - DPRINTF(("ah_output(): failed to acquire crypto " - "descriptors\n")); + DPRINTF(("%s: failed to acquire crypto descriptors\n", + __func__)); ahstat.ahs_crypto++; return ENOBUFS; } @@ -1114,7 +1114,7 @@ ah_output(struct mbuf *m, struct tdb *td if (tc == NULL) { m_freem(m); crypto_freereq(crp); - DPRINTF(("ah_output(): failed to allocate tdb_crypto\n")); + DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); ahstat.ahs_crypto++; return ENOBUFS; } @@ -1204,8 +1204,7 @@ ah_output_cb(struct cryptop *crp) free(tc, M_XDATA, 0); crypto_freereq(crp); ahstat.ahs_crypto++; - DPRINTF(("ah_output_cb(): bogus returned buffer from " - "crypto\n")); + DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); return; } @@ -1215,7 +1214,7 @@ ah_output_cb(struct cryptop *crp) if (tdb == NULL) { free(tc, M_XDATA, 0); ahstat.ahs_notdb++; - DPRINTF(("ah_output_cb(): TDB is expired while in crypto\n")); + DPRINTF(("%s: TDB is expired while in crypto\n", __func__)); goto baddone; } @@ -1231,7 +1230,7 @@ ah_output_cb(struct cryptop *crp) } free(tc, M_XDATA, 0); ahstat.ahs_noxform++; - DPRINTF(("ah_output_cb(): crypto error %d\n", crp->crp_etype)); + DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); goto baddone; } Index: netinet/ip_esp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_esp.c,v retrieving revision 1.150 diff -u -p -r1.150 ip_esp.c --- netinet/ip_esp.c 11 Aug 2017 21:24:20 -0000 1.150 +++ netinet/ip_esp.c 6 Nov 2017 12:48:40 -0000 @@ -352,7 +352,7 @@ esp_input(struct mbuf *m, struct tdb *td alen = esph ? esph->authsize : 0; plen = m->m_pkthdr.len - (skip + hlen + alen); if (plen <= 0) { - DPRINTF(("esp_input: invalid payload length\n")); + DPRINTF(("%s: invalid payload length\n", __func__)); espstat.esps_badilen++; m_freem(m); return EINVAL; @@ -364,8 +364,8 @@ esp_input(struct mbuf *m, struct tdb *td * block size. */ if (plen & (espx->blocksize - 1)) { - DPRINTF(("esp_input(): payload of %d octets " - "not a multiple of %d octets, SA %s/%08x\n", + DPRINTF(("%s: payload of %d octets not a multiple of %d" + " octets, SA %s/%08x\n", __func__, plen, espx->blocksize, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_badilen++; @@ -385,32 +385,33 @@ esp_input(struct mbuf *m, struct tdb *td break; case 1: m_freem(m); - DPRINTF(("esp_input(): replay counter wrapped" - " for SA %s/%08x\n", + DPRINTF(("%s: replay counter wrapped for SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_wrap++; return EACCES; case 2: m_freem(m); - DPRINTF(("esp_input(): old packet received" - " in SA %s/%08x\n", + DPRINTF(("%s: old packet received in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_replay++; return EACCES; case 3: m_freem(m); - DPRINTF(("esp_input(): duplicate packet received" - " in SA %s/%08x\n", + DPRINTF(("%s: duplicate packet received" + " in SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_replay++; return EACCES; default: m_freem(m); - DPRINTF(("esp_input(): bogus value from" + DPRINTF(("%s: bogus value from" " checkreplaywindow() in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_replay++; @@ -442,7 +443,7 @@ esp_input(struct mbuf *m, struct tdb *td crp = crypto_getreq(esph && espx ? 2 : 1); if (crp == NULL) { m_freem(m); - DPRINTF(("esp_input(): failed to acquire crypto descriptors\n")); + DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); espstat.esps_crypto++; return ENOBUFS; } @@ -455,7 +456,7 @@ esp_input(struct mbuf *m, struct tdb *td if (tc == NULL) { m_freem(m); crypto_freereq(crp); - DPRINTF(("esp_input(): failed to allocate tdb_crypto\n")); + DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); espstat.esps_crypto++; return ENOBUFS; } @@ -552,7 +553,7 @@ esp_input_cb(struct cryptop *crp) free(tc, M_XDATA, 0); crypto_freereq(crp); espstat.esps_crypto++; - DPRINTF(("esp_input_cb(): bogus returned buffer from crypto\n")); + DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); return; } @@ -562,7 +563,7 @@ esp_input_cb(struct cryptop *crp) if (tdb == NULL) { free(tc, M_XDATA, 0); espstat.esps_notdb++; - DPRINTF(("esp_input_cb(): TDB is expired while in crypto")); + DPRINTF(("%s: TDB is expired while in crypto", __func__)); goto baddone; } @@ -580,7 +581,7 @@ esp_input_cb(struct cryptop *crp) } free(tc, M_XDATA, 0); espstat.esps_noxform++; - DPRINTF(("esp_input_cb(): crypto error %d\n", crp->crp_etype)); + DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); goto baddone; } @@ -595,8 +596,8 @@ esp_input_cb(struct cryptop *crp) /* Verify authenticator */ if (timingsafe_bcmp(ptr, aalg, esph->authsize)) { free(tc, M_XDATA, 0); - DPRINTF(("esp_input_cb(): authentication " - "failed for packet in SA %s/%08x\n", + DPRINTF(("%s: authentication " + "failed for packet in SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_badauth++; @@ -622,29 +623,29 @@ esp_input_cb(struct cryptop *crp) break; case 1: - DPRINTF(("esp_input_cb(): replay counter wrapped" - " for SA %s/%08x\n", + DPRINTF(("%s: replay counter wrapped for SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_wrap++; goto baddone; case 2: - DPRINTF(("esp_input_cb(): old packet received" - " in SA %s/%08x\n", + DPRINTF(("%s: old packet received in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_replay++; goto baddone; case 3: - DPRINTF(("esp_input_cb(): duplicate packet received" - " in SA %s/%08x\n", + DPRINTF(("%s: duplicate packet received" + " in SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_replay++; goto baddone; default: - DPRINTF(("esp_input_cb(): bogus value from" - " checkreplaywindow() in SA %s/%08x\n", + DPRINTF(("%s: bogus value from" + " checkreplaywindow() in SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_replay++; @@ -663,7 +664,7 @@ esp_input_cb(struct cryptop *crp) if (m1 == NULL) { espstat.esps_hdrops++; NET_UNLOCK(); - DPRINTF(("esp_input_cb(): bad mbuf chain, SA %s/%08x\n", + DPRINTF(("%s: bad mbuf chain, SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -721,8 +722,8 @@ esp_input_cb(struct cryptop *crp) if (lastthree[1] + 2 > m->m_pkthdr.len - skip) { espstat.esps_badilen++; NET_UNLOCK(); - DPRINTF(("esp_input_cb(): invalid padding length %d for " - "packet in SA %s/%08x\n", lastthree[1], + DPRINTF(("%s: invalid padding length %d for packet in " + "SA %s/%08x\n", __func__, lastthree[1], ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -733,8 +734,8 @@ esp_input_cb(struct cryptop *crp) if ((lastthree[1] != lastthree[0]) && (lastthree[1] != 0)) { espstat.esps_badenc++; NET_UNLOCK(); - DPRINTF(("esp_input(): decryption failed for packet in " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: decryption failed for packet in SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); return; @@ -821,8 +822,8 @@ esp_output(struct mbuf *m, struct tdb *t case AF_INET: /* Check for IP maximum packet size violations. */ if (skip + hlen + rlen + padding + alen > IP_MAXPACKET) { - DPRINTF(("esp_output(): packet in SA %s/%08x got " - "too big\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: packet in SA %s/%08x got too big\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -835,8 +836,8 @@ esp_output(struct mbuf *m, struct tdb *t case AF_INET6: /* Check for IPv6 maximum packet size violations. */ if (skip + hlen + rlen + padding + alen > IPV6_MAXPACKET) { - DPRINTF(("esp_output(): packet in SA %s/%08x got too " - "big\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: packet in SA %s/%08x got too big\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); espstat.esps_toobig++; @@ -846,8 +847,8 @@ esp_output(struct mbuf *m, struct tdb *t #endif /* INET6 */ default: - DPRINTF(("esp_output(): unknown/unsupported protocol " - "family %d, SA %s/%08x\n", tdb->tdb_dst.sa.sa_family, + DPRINTF(("%s: unknown/unsupported protocol family %d, " + "SA %s/%08x\n", __func__, tdb->tdb_dst.sa.sa_family, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -887,7 +888,7 @@ esp_output(struct mbuf *m, struct tdb *t struct mbuf *n = m_dup_pkt(m, 0, M_DONTWAIT); if (n == NULL) { - DPRINTF(("esp_output(): bad mbuf chain, SA %s/%08x\n", + DPRINTF(("%s: bad mbuf chain, SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); espstat.esps_hdrops++; @@ -902,8 +903,8 @@ esp_output(struct mbuf *m, struct tdb *t /* Inject ESP header. */ mo = m_makespace(m, skip, hlen, &roff); if (mo == NULL) { - DPRINTF(("esp_output(): failed to inject ESP header for " - "SA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: failed to inject ESP header for SA %s/%08x\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); espstat.esps_hdrops++; @@ -928,7 +929,7 @@ esp_output(struct mbuf *m, struct tdb *t */ mo = m_makespace(m, m->m_pkthdr.len, padding + alen, &roff); if (mo == NULL) { - DPRINTF(("esp_output(): m_makespace() failed for SA %s/%08x\n", + DPRINTF(("%s: m_makespace() failed for SA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -952,8 +953,8 @@ esp_output(struct mbuf *m, struct tdb *t crp = crypto_getreq(esph && espx ? 2 : 1); if (crp == NULL) { m_freem(m); - DPRINTF(("esp_output(): failed to acquire crypto " - "descriptors\n")); + DPRINTF(("%s: failed to acquire crypto descriptors\n", + __func__)); espstat.esps_crypto++; return ENOBUFS; } @@ -985,7 +986,7 @@ esp_output(struct mbuf *m, struct tdb *t if (tc == NULL) { m_freem(m); crypto_freereq(crp); - DPRINTF(("esp_output(): failed to allocate tdb_crypto\n")); + DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); espstat.esps_crypto++; return ENOBUFS; } @@ -1050,8 +1051,7 @@ esp_output_cb(struct cryptop *crp) free(tc, M_XDATA, 0); crypto_freereq(crp); espstat.esps_crypto++; - DPRINTF(("esp_output_cb(): bogus returned buffer from " - "crypto\n")); + DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); return; } @@ -1062,7 +1062,7 @@ esp_output_cb(struct cryptop *crp) if (tdb == NULL) { free(tc, M_XDATA, 0); espstat.esps_notdb++; - DPRINTF(("esp_output_cb(): TDB is expired while in crypto\n")); + DPRINTF(("%s: TDB is expired while in crypto\n", __func__)); goto baddone; } @@ -1078,8 +1078,7 @@ esp_output_cb(struct cryptop *crp) } free(tc, M_XDATA, 0); espstat.esps_noxform++; - DPRINTF(("esp_output_cb(): crypto error %d\n", - crp->crp_etype)); + DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); goto baddone; } free(tc, M_XDATA, 0); Index: netinet/ip_ether.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_ether.c,v retrieving revision 1.87 diff -u -p -r1.87 ip_ether.c --- netinet/ip_ether.c 9 Oct 2017 08:35:38 -0000 1.87 +++ netinet/ip_ether.c 6 Nov 2017 12:51:13 -0000 @@ -95,7 +95,7 @@ etherip_input(struct mbuf **mp, int *off case IPPROTO_ETHERIP: /* If we do not accept EtherIP explicitly, drop. */ if (!etherip_allow && ((*mp)->m_flags & (M_AUTH|M_CONF)) == 0) { - DPRINTF(("etherip_input(): dropped due to policy\n")); + DPRINTF(("%s: dropped due to policy\n", __func__)); etheripstat.etherips_pdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -109,7 +109,7 @@ etherip_input(struct mbuf **mp, int *off return IPPROTO_DONE; #endif default: - DPRINTF(("etherip_input(): dropped, unhandled protocol\n")); + DPRINTF(("%s: dropped, unhandled protocol\n", __func__)); etheripstat.etherips_pdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -132,7 +132,7 @@ etherip_decap(struct mbuf *m, int iphlen */ if (m->m_pkthdr.len < iphlen + sizeof(struct ether_header) + sizeof(struct etherip_header)) { - DPRINTF(("etherip_input(): encapsulated packet too short\n")); + DPRINTF(("%s: encapsulated packet too short\n", __func__)); etheripstat.etherips_hdrops++; m_freem(m); return; @@ -143,8 +143,8 @@ etherip_decap(struct mbuf *m, int iphlen if (eip.eip_ver == ETHERIP_VERSION) { /* Correct */ } else { - DPRINTF(("etherip_input(): received EtherIP version number " - "%d not suppoorted\n", eip.eip_ver)); + DPRINTF(("%s: received EtherIP version number %d not " + "supported\n", __func__, eip.eip_ver)); etheripstat.etherips_adrops++; m_freem(m); return; @@ -152,8 +152,7 @@ etherip_decap(struct mbuf *m, int iphlen /* Finally, the pad value must be zero. */ if (eip.eip_pad) { - DPRINTF(("etherip_input(): received EtherIP invalid " - "pad value\n")); + DPRINTF(("%s: received EtherIP invalid pad value\n", __func__)); etheripstat.etherips_adrops++; m_freem(m); return; @@ -164,7 +163,7 @@ etherip_decap(struct mbuf *m, int iphlen sizeof(struct etherip_header)) { if ((m = m_pullup(m, iphlen + sizeof(struct ether_header) + sizeof(struct etherip_header))) == NULL) { - DPRINTF(("etherip_input(): m_pullup() failed\n")); + DPRINTF(("%s: m_pullup() failed\n", __func__)); etheripstat.etherips_adrops++; return; } @@ -174,7 +173,7 @@ etherip_decap(struct mbuf *m, int iphlen if (sc == NULL) return; if (sc->gif_if.if_bridgeport == NULL) { - DPRINTF(("etherip_input(): interface not part of bridge\n")); + DPRINTF(("%s: interface not part of bridge\n", __func__)); etheripstat.etherips_noifdrops++; m_freem(m); return; @@ -211,7 +210,7 @@ mplsip_decap(struct mbuf *m, int iphlen) * the outer IP header. */ if (m->m_pkthdr.len < iphlen + sizeof(struct shim_hdr)) { - DPRINTF(("mplsip_input(): encapsulated packet too short\n")); + DPRINTF(("%s: encapsulated packet too short\n", __func__)); etheripstat.etherips_hdrops++; m_freem(m); return; @@ -221,7 +220,7 @@ mplsip_decap(struct mbuf *m, int iphlen) if (m->m_len < iphlen + sizeof(struct shim_hdr)) { if ((m = m_pullup(m, iphlen + sizeof(struct shim_hdr))) == NULL) { - DPRINTF(("mplsip_input(): m_pullup() failed\n")); + DPRINTF(("%s: m_pullup() failed\n", __func__)); etheripstat.etherips_adrops++; return; } @@ -291,7 +290,7 @@ etherip_getgif(struct mbuf *m) break; #endif /* INET6 */ default: - DPRINTF(("etherip_input(): invalid protocol %d\n", v)); + DPRINTF(("%s: invalid protocol %d\n", __func__, v)); m_freem(m); etheripstat.etherips_hdrops++; return NULL; @@ -311,7 +310,7 @@ etherip_getgif(struct mbuf *m) /* None found. */ if (sc == NULL) { - DPRINTF(("etherip_input(): no interface found\n")); + DPRINTF(("%s: no interface found\n", __func__)); etheripstat.etherips_noifdrops++; m_freem(m); return NULL; @@ -334,8 +333,8 @@ etherip_output(struct mbuf *m, struct td if ((tdb->tdb_src.sa.sa_family != 0) && (tdb->tdb_src.sa.sa_family != AF_INET) && (tdb->tdb_src.sa.sa_family != AF_INET6)) { - DPRINTF(("etherip_output(): IP in protocol-family <%d> " - "attempted, aborting", tdb->tdb_src.sa.sa_family)); + DPRINTF(("%s: IP in protocol-family <%d> attempted, aborting", + __func__, tdb->tdb_src.sa.sa_family)); etheripstat.etherips_adrops++; m_freem(m); return EINVAL; @@ -343,16 +342,16 @@ etherip_output(struct mbuf *m, struct td if ((tdb->tdb_dst.sa.sa_family != AF_INET) && (tdb->tdb_dst.sa.sa_family != AF_INET6)) { - DPRINTF(("etherip_output(): IP in protocol-family <%d> " - "attempted, aborting", tdb->tdb_dst.sa.sa_family)); + DPRINTF(("%s: IP in protocol-family <%d> attempted, aborting", + __func__, tdb->tdb_dst.sa.sa_family)); etheripstat.etherips_adrops++; m_freem(m); return EINVAL; } if (tdb->tdb_dst.sa.sa_family != tdb->tdb_src.sa.sa_family) { - DPRINTF(("etherip_output(): mismatch in tunnel source and " - "destination address protocol families (%d/%d), aborting", + DPRINTF(("%s: mismatch in tunnel source and destination address" + " protocol families (%d/%d), aborting", __func__, tdb->tdb_src.sa.sa_family, tdb->tdb_dst.sa.sa_family)); etheripstat.etherips_adrops++; m_freem(m); @@ -369,8 +368,8 @@ etherip_output(struct mbuf *m, struct td break; #endif /* INET6 */ default: - DPRINTF(("etherip_output(): unsupported tunnel protocol " - "family <%d>, aborting", tdb->tdb_dst.sa.sa_family)); + DPRINTF(("%s: unsupported tunnel protocol family <%d>, " + "aborting", __func__, tdb->tdb_dst.sa.sa_family)); etheripstat.etherips_adrops++; m_freem(m); return EINVAL; @@ -382,7 +381,7 @@ etherip_output(struct mbuf *m, struct td M_PREPEND(m, hlen, M_DONTWAIT); if (m == NULL) { - DPRINTF(("etherip_output(): M_PREPEND failed\n")); + DPRINTF(("%s: M_PREPEND failed\n", __func__)); etheripstat.etherips_adrops++; return ENOBUFS; } Index: netinet/ip_ipcomp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_ipcomp.c,v retrieving revision 1.57 diff -u -p -r1.57 ip_ipcomp.c --- netinet/ip_ipcomp.c 11 Aug 2017 21:24:20 -0000 1.57 +++ netinet/ip_ipcomp.c 6 Nov 2017 12:54:23 -0000 @@ -94,14 +94,14 @@ ipcomp_init(struct tdb *tdbp, struct xfo break; default: - DPRINTF(("ipcomp_init(): unsupported compression algorithm %d specified\n", - ii->ii_compalg)); + DPRINTF(("%s: unsupported compression algorithm %d specified\n", + __func__, ii->ii_compalg)); return EINVAL; } tdbp->tdb_compalgxform = tcomp; - DPRINTF(("ipcomp_init(): initialized TDB with ipcomp algorithm %s\n", + DPRINTF(("%s: initialized TDB with ipcomp algorithm %s\n", __func__, tcomp->name)); tdbp->tdb_xform = xsp; @@ -145,7 +145,7 @@ ipcomp_input(struct mbuf *m, struct tdb crp = crypto_getreq(1); if (crp == NULL) { m_freem(m); - DPRINTF(("ipcomp_input(): failed to acquire crypto descriptors\n")); + DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); ipcompstat.ipcomps_crypto++; return ENOBUFS; } @@ -154,7 +154,7 @@ ipcomp_input(struct mbuf *m, struct tdb if (tc == NULL) { m_freem(m); crypto_freereq(crp); - DPRINTF(("ipcomp_input(): failed to allocate tdb_crypto\n")); + DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); ipcompstat.ipcomps_crypto++; return ENOBUFS; } @@ -213,7 +213,7 @@ ipcomp_input_cb(struct cryptop *crp) free(tc, M_XDATA, 0); crypto_freereq(crp); ipcompstat.ipcomps_crypto++; - DPRINTF(("ipcomp_input_cb(): bogus returned buffer from crypto\n")); + DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); return; } @@ -223,7 +223,7 @@ ipcomp_input_cb(struct cryptop *crp) if (tdb == NULL) { free(tc, M_XDATA, 0); ipcompstat.ipcomps_notdb++; - DPRINTF(("ipcomp_input_cb(): TDB expired while in crypto")); + DPRINTF(("%s: TDB expired while in crypto", __func__)); goto baddone; } @@ -258,7 +258,7 @@ ipcomp_input_cb(struct cryptop *crp) } free(tc, M_XDATA, 0); ipcompstat.ipcomps_noxform++; - DPRINTF(("ipcomp_input_cb(): crypto error %d\n", + DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); goto baddone; } @@ -278,7 +278,7 @@ ipcomp_input_cb(struct cryptop *crp) m1 = m_getptr(m, skip, &roff); if (m1 == NULL) { ipcompstat.ipcomps_hdrops++; - DPRINTF(("ipcomp_input_cb(): bad mbuf chain, IPCA %s/%08x\n", + DPRINTF(("%s: bad mbuf chain, IPCA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); goto baddone; @@ -391,8 +391,8 @@ ipcomp_output(struct mbuf *m, struct tdb * worry */ if (m->m_pkthdr.len + hlen > IP_MAXPACKET) { - DPRINTF(("ipcomp_output(): packet in IPCA %s/%08x " - "got too big\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: packet in IPCA %s/%08x got too big\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); ipcompstat.ipcomps_toobig++; @@ -404,8 +404,8 @@ ipcomp_output(struct mbuf *m, struct tdb case AF_INET6: /* Check for IPv6 maximum packet size violations */ if (m->m_pkthdr.len + hlen > IPV6_MAXPACKET) { - DPRINTF(("ipcomp_output(): packet in IPCA %s/%08x " - "got too big\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: packet in IPCA %s/%08x got too big\n", + __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); ipcompstat.ipcomps_toobig++; @@ -415,8 +415,8 @@ ipcomp_output(struct mbuf *m, struct tdb #endif /* INET6 */ default: - DPRINTF(("ipcomp_output(): unknown/unsupported protocol " - "family %d, IPCA %s/%08x\n", tdb->tdb_dst.sa.sa_family, + DPRINTF(("%s: unknown/unsupported protocol family %d, " + "IPCA %s/%08x\n", __func__, tdb->tdb_dst.sa.sa_family, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); m_freem(m); @@ -455,7 +455,7 @@ ipcomp_output(struct mbuf *m, struct tdb struct mbuf *n = m_dup_pkt(m, 0, M_DONTWAIT); if (n == NULL) { - DPRINTF(("ipcomp_output(): bad mbuf chain, IPCA %s/%08x\n", + DPRINTF(("%s: bad mbuf chain, IPCA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ipcompstat.ipcomps_hdrops++; @@ -472,7 +472,7 @@ ipcomp_output(struct mbuf *m, struct tdb crp = crypto_getreq(1); if (crp == NULL) { m_freem(m); - DPRINTF(("ipcomp_output(): failed to acquire crypto descriptors\n")); + DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); ipcompstat.ipcomps_crypto++; return ENOBUFS; } @@ -492,7 +492,7 @@ ipcomp_output(struct mbuf *m, struct tdb if (tc == NULL) { m_freem(m); crypto_freereq(crp); - DPRINTF(("ipcomp_output(): failed to allocate tdb_crypto\n")); + DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); ipcompstat.ipcomps_crypto++; return ENOBUFS; } @@ -544,8 +544,7 @@ ipcomp_output_cb(struct cryptop *crp) free(tc, M_XDATA, 0); crypto_freereq(crp); ipcompstat.ipcomps_crypto++; - DPRINTF(("ipcomp_output_cb(): bogus returned buffer from " - "crypto\n")); + DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); return; } @@ -555,7 +554,7 @@ ipcomp_output_cb(struct cryptop *crp) if (tdb == NULL) { free(tc, M_XDATA, 0); ipcompstat.ipcomps_notdb++; - DPRINTF(("ipcomp_output_cb(): TDB expired while in crypto\n")); + DPRINTF(("%s: TDB expired while in crypto\n", __func__)); goto baddone; } @@ -571,8 +570,7 @@ ipcomp_output_cb(struct cryptop *crp) } free(tc, M_XDATA, 0); ipcompstat.ipcomps_noxform++; - DPRINTF(("ipcomp_output_cb(): crypto error %d\n", - crp->crp_etype)); + DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); goto baddone; } free(tc, M_XDATA, 0); @@ -590,8 +588,8 @@ ipcomp_output_cb(struct cryptop *crp) /* Inject IPCOMP header */ mo = m_makespace(m, skip, IPCOMP_HLENGTH, &roff); if (mo == NULL) { - DPRINTF(("ipcomp_output_cb(): failed to inject IPCOMP header " - "for IPCA %s/%08x\n", ipsp_address(&tdb->tdb_dst, buf, + DPRINTF(("%s: failed to inject IPCOMP header for " + "IPCA %s/%08x\n", __func__, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ipcompstat.ipcomps_wrap++; goto baddone; @@ -618,8 +616,8 @@ ipcomp_output_cb(struct cryptop *crp) break; #endif default: - DPRINTF(("ipcomp_output_cb(): unsupported protocol family %d, " - "IPCA %s/%08x\n", tdb->tdb_dst.sa.sa_family, + DPRINTF(("%s: unsupported protocol family %d, IPCA %s/%08x\n", + __func__, tdb->tdb_dst.sa.sa_family, ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), ntohl(tdb->tdb_spi))); ipcompstat.ipcomps_nopf++; Index: netinet/ip_ipsp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_ipsp.c,v retrieving revision 1.228 diff -u -p -r1.228 ip_ipsp.c --- netinet/ip_ipsp.c 16 Oct 2017 08:22:25 -0000 1.228 +++ netinet/ip_ipsp.c 6 Nov 2017 12:54:59 -0000 @@ -889,7 +889,7 @@ tdb_init(struct tdb *tdbp, u_int16_t alg } } - DPRINTF(("tdb_init(): no alg %d for spi %08x, addr %s, proto %d\n", + DPRINTF(("%s: no alg %d for spi %08x, addr %s, proto %d\n", __func__, alg, ntohl(tdbp->tdb_spi), ipsp_address(&tdbp->tdb_dst, buf, sizeof(buf)), tdbp->tdb_sproto)); Index: netinet/ipsec_output.c =================================================================== RCS file: /cvs/src/sys/netinet/ipsec_output.c,v retrieving revision 1.68 diff -u -p -r1.68 ipsec_output.c --- netinet/ipsec_output.c 18 May 2017 10:56:45 -0000 1.68 +++ netinet/ipsec_output.c 6 Nov 2017 12:24:08 -0000 @@ -95,7 +95,7 @@ ipsp_process_packet(struct mbuf *m, stru /* Sanity check. */ if (!tdb->tdb_xform) { - DPRINTF(("ipsp_process_packet(): uninitialized TDB\n")); + DPRINTF(("%s: uninitialized TDB\n", __func__)); m_freem(m); return EHOSTUNREACH; } Index: netinet/ipsec_input.c =================================================================== RCS file: /cvs/src/sys/netinet/ipsec_input.c,v retrieving revision 1.157 diff -u -p -r1.157 ipsec_input.c --- netinet/ipsec_input.c 9 Oct 2017 08:35:38 -0000 1.157 +++ netinet/ipsec_input.c 6 Nov 2017 13:00:31 -0000 @@ -125,7 +125,7 @@ ipsec_common_input(struct mbuf *m, int s ipcompstat.ipcomps_input); if (m == NULL) { - DPRINTF(("ipsec_common_input(): NULL packet received\n")); + DPRINTF(("%s: NULL packet received\n", __func__)); IPSEC_ISTAT(espstat.esps_hdrops, ahstat.ahs_hdrops, ipcompstat.ipcomps_hdrops); return EINVAL; @@ -147,8 +147,8 @@ ipsec_common_input(struct mbuf *m, int s break; #endif /* INET6 */ default: - DPRINTF(("ipsec_common_input(): unsupported protocol " - "family %d\n", af)); + DPRINTF(("%s: unsupported protocol family %d\n", + __func__, af)); m_freem(m); IPSEC_ISTAT(espstat.esps_nopf, ahstat.ahs_nopf, ipcompstat.ipcomps_nopf); @@ -159,7 +159,7 @@ ipsec_common_input(struct mbuf *m, int s if ((sproto == IPPROTO_IPCOMP) && (m->m_flags & M_COMP)) { m_freem(m); ipcompstat.ipcomps_pdrops++; - DPRINTF(("ipsec_common_input(): repeated decompression\n")); + DPRINTF(("%s: repeated decompression\n", __func__)); return EINVAL; } @@ -167,7 +167,7 @@ ipsec_common_input(struct mbuf *m, int s m_freem(m); IPSEC_ISTAT(espstat.esps_hdrops, ahstat.ahs_hdrops, ipcompstat.ipcomps_hdrops); - DPRINTF(("ipsec_common_input(): packet too small\n")); + DPRINTF(("%s: packet too small\n", __func__)); return EINVAL; } @@ -219,8 +219,7 @@ ipsec_common_input(struct mbuf *m, int s #endif /* INET6 */ default: - DPRINTF(("ipsec_common_input(): unsupported protocol " - "family %d\n", af)); + DPRINTF(("%s: unsupported protocol family %d\n", __func__, af)); m_freem(m); IPSEC_ISTAT(espstat.esps_nopf, ahstat.ahs_nopf, ipcompstat.ipcomps_nopf); @@ -230,8 +229,8 @@ ipsec_common_input(struct mbuf *m, int s tdbp = gettdb(rtable_l2(m->m_pkthdr.ph_rtableid), spi, &dst_address, sproto); if (tdbp == NULL) { - DPRINTF(("ipsec_common_input(): could not find SA for " - "packet to %s, spi %08x\n", + DPRINTF(("%s: could not find SA for packet to %s, spi %08x\n", + __func__, ipsp_address(&dst_address, buf, sizeof(buf)), ntohl(spi))); m_freem(m); IPSEC_ISTAT(espstat.esps_notdb, ahstat.ahs_notdb, @@ -240,8 +239,8 @@ ipsec_common_input(struct mbuf *m, int s } if (tdbp->tdb_flags & TDBF_INVALID) { - DPRINTF(("ipsec_common_input(): attempted to use invalid " - "SA %s/%08x/%u\n", ipsp_address(&dst_address, buf, + DPRINTF(("%s: attempted to use invalid SA %s/%08x/%u\n", + __func__, ipsp_address(&dst_address, buf, sizeof(buf)), ntohl(spi), tdbp->tdb_sproto)); m_freem(m); IPSEC_ISTAT(espstat.esps_invalid, ahstat.ahs_invalid, @@ -250,8 +249,8 @@ ipsec_common_input(struct mbuf *m, int s } if (udpencap && !(tdbp->tdb_flags & TDBF_UDPENCAP)) { - DPRINTF(("ipsec_common_input(): attempted to use non-udpencap " - "SA %s/%08x/%u\n", ipsp_address(&dst_address, buf, + DPRINTF(("%s: attempted to use non-udpencap SA %s/%08x/%u\n", + __func__, ipsp_address(&dst_address, buf, sizeof(buf)), ntohl(spi), tdbp->tdb_sproto)); m_freem(m); espstat.esps_udpinval++; @@ -259,8 +258,8 @@ ipsec_common_input(struct mbuf *m, int s } if (!udpencap && (tdbp->tdb_flags & TDBF_UDPENCAP)) { - DPRINTF(("ipsec_common_input(): attempted to use udpencap " - "SA %s/%08x/%u\n", ipsp_address(&dst_address, buf, + DPRINTF(("%s: attempted to use udpencap SA %s/%08x/%u\n", + __func__, ipsp_address(&dst_address, buf, sizeof(buf)), ntohl(spi), tdbp->tdb_sproto)); m_freem(m); espstat.esps_udpneeded++; @@ -268,8 +267,8 @@ ipsec_common_input(struct mbuf *m, int s } if (tdbp->tdb_xform == NULL) { - DPRINTF(("ipsec_common_input(): attempted to use uninitialized " - "SA %s/%08x/%u\n", ipsp_address(&dst_address, buf, + DPRINTF(("%s: attempted to use uninitialized SA %s/%08x/%u\n", + __func__, ipsp_address(&dst_address, buf, sizeof(buf)), ntohl(spi), tdbp->tdb_sproto)); m_freem(m); IPSEC_ISTAT(espstat.esps_noxform, ahstat.ahs_noxform, @@ -280,8 +279,8 @@ ipsec_common_input(struct mbuf *m, int s if (sproto != IPPROTO_IPCOMP) { if ((encif = enc_getif(tdbp->tdb_rdomain, tdbp->tdb_tap)) == NULL) { - DPRINTF(("ipsec_common_input(): " - "no enc%u interface for SA %s/%08x/%u\n", + DPRINTF(("%s: no enc%u interface for SA %s/%08x/%u\n", + __func__, tdbp->tdb_tap, ipsp_address(&dst_address, buf, sizeof(buf)), ntohl(spi), tdbp->tdb_sproto)); m_freem(m); @@ -357,8 +356,8 @@ ipsec_common_input_cb(struct mbuf *m, st /* Fix IPv4 header */ if (af == AF_INET) { if ((m->m_len < skip) && ((m = m_pullup(m, skip)) == NULL)) { - DPRINTF(("ipsec_common_input_cb(): processing failed " - "for SA %s/%08x\n", ipsp_address(&tdbp->tdb_dst, + DPRINTF(("%s: processing failed for SA %s/%08x\n", + __func__, ipsp_address(&tdbp->tdb_dst, buf, sizeof(buf)), ntohl(tdbp->tdb_spi))); IPSEC_ISTAT(espstat.esps_hdrops, ahstat.ahs_hdrops, ipcompstat.ipcomps_hdrops); @@ -409,8 +408,8 @@ ipsec_common_input_cb(struct mbuf *m, st if (m->m_len < sizeof(struct ip6_hdr) && (m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { - DPRINTF(("ipsec_common_input_cb(): processing failed " - "for SA %s/%08x\n", ipsp_address(&tdbp->tdb_dst, + DPRINTF(("%s: processing failed for SA %s/%08x\n", + __func__, ipsp_address(&tdbp->tdb_dst, buf, sizeof(buf)), ntohl(tdbp->tdb_spi))); IPSEC_ISTAT(espstat.esps_hdrops, ahstat.ahs_hdrops, @@ -517,8 +516,7 @@ ipsec_common_input_cb(struct mbuf *m, st sizeof(struct tdb_ident), M_NOWAIT); if (mtag == NULL) { m_freem(m); - DPRINTF(("ipsec_common_input_cb(): failed to " - "get tag\n")); + DPRINTF(("%s: failed to get tag\n", __func__)); IPSEC_ISTAT(espstat.esps_hdrops, ahstat.ahs_hdrops, ipcompstat.ipcomps_hdrops); return; @@ -792,8 +790,7 @@ ipsec_common_ctlinput(u_int rdomain, int tdbp->tdb_mtu = mtu; tdbp->tdb_mtutimeout = time_second + ip_mtudisc_timeout; - DPRINTF(("ipsec_common_ctlinput: " - "spi %08x mtu %d adjust %ld\n", + DPRINTF(("%s: spi %08x mtu %d adjust %ld\n", __func__, ntohl(tdbp->tdb_spi), tdbp->tdb_mtu, adjust)); } @@ -848,8 +845,8 @@ udpencap_ctlinput(int cmd, struct sockad tdbp->tdb_mtu = mtu - adjust; tdbp->tdb_mtutimeout = time_second + ip_mtudisc_timeout; - DPRINTF(("udpencap_ctlinput: " - "spi %08x mtu %d adjust %ld\n", + DPRINTF(("%s: spi %08x mtu %d adjust %ld\n", + __func__, ntohl(tdbp->tdb_spi), tdbp->tdb_mtu, adjust)); } @@ -878,7 +875,7 @@ ah6_input(struct mbuf **mp, int *offp, i struct ip6_ext ip6e; if (*offp < sizeof(struct ip6_hdr)) { - DPRINTF(("ah6_input(): bad offset\n")); + DPRINTF(("%s: bad offset\n", __func__)); ahstat.ahs_hdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -908,7 +905,7 @@ ah6_input(struct mbuf **mp, int *offp, i /* Malformed packet check */ if (protoff + l != *offp) { - DPRINTF(("ah6_input(): bad packet header chain\n")); + DPRINTF(("%s: bad packet header chain\n", __func__)); ahstat.ahs_hdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -928,7 +925,7 @@ esp6_input(struct mbuf **mp, int *offp, struct ip6_ext ip6e; if (*offp < sizeof(struct ip6_hdr)) { - DPRINTF(("esp6_input(): bad offset\n")); + DPRINTF(("%s: bad offset\n", __func__)); espstat.esps_hdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -958,7 +955,7 @@ esp6_input(struct mbuf **mp, int *offp, /* Malformed packet check */ if (protoff + l != *offp) { - DPRINTF(("esp6_input(): bad packet header chain\n")); + DPRINTF(("%s: bad packet header chain\n", __func__)); espstat.esps_hdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -979,7 +976,7 @@ ipcomp6_input(struct mbuf **mp, int *off struct ip6_ext ip6e; if (*offp < sizeof(struct ip6_hdr)) { - DPRINTF(("ipcomp6_input(): bad offset\n")); + DPRINTF(("%s: bad offset\n", __func__)); ipcompstat.ipcomps_hdrops++; m_freemp(mp); return IPPROTO_DONE; @@ -1000,7 +997,7 @@ ipcomp6_input(struct mbuf **mp, int *off l = (ip6e.ip6e_len + 1) << 3; #ifdef DIAGNOSTIC if (l <= 0) - panic("ipcomp6_input: l went zero or negative"); + panic("l went zero or negative"); #endif nxt = ip6e.ip6e_nxt; @@ -1008,7 +1005,7 @@ ipcomp6_input(struct mbuf **mp, int *off /* Malformed packet check */ if (protoff + l != *offp) { - DPRINTF(("ipcomp6_input(): bad packet header chain\n")); + DPRINTF(("%s: bad packet header chain\n", __func__)); ipcompstat.ipcomps_hdrops++; m_freemp(mp); return IPPROTO_DONE;