From 050a9aad942e91481033f2d67c50d3fd608596c2 Mon Sep 17 00:00:00 2001 From: suz Date: Tue, 29 Apr 2003 08:43:56 +0000 Subject: panic() doesn't need \n Obtained from: KAME MFC after: 2 days --- sys/netinet6/ah_output.c | 2 +- sys/netinet6/esp_output.c | 2 +- sys/netinet6/icmp6.c | 2 +- sys/netinet6/in6_cksum.c | 8 ++--- sys/netinet6/ipsec.c | 78 +++++++++++++++++++++++------------------------ sys/netinet6/nd6.c | 14 ++++----- 6 files changed, 53 insertions(+), 53 deletions(-) diff --git a/sys/netinet6/ah_output.c b/sys/netinet6/ah_output.c index e850752..0887c41 100644 --- a/sys/netinet6/ah_output.c +++ b/sys/netinet6/ah_output.c @@ -94,7 +94,7 @@ ah_hdrsiz(isr) /* sanity check */ if (isr == NULL) - panic("ah_hdrsiz: NULL was passed.\n"); + panic("ah_hdrsiz: NULL was passed."); if (isr->saidx.proto != IPPROTO_AH) panic("unsupported mode passed to ah_hdrsiz"); diff --git a/sys/netinet6/esp_output.c b/sys/netinet6/esp_output.c index 3e89c5d..0365e20 100644 --- a/sys/netinet6/esp_output.c +++ b/sys/netinet6/esp_output.c @@ -98,7 +98,7 @@ esp_hdrsiz(isr) /* sanity check */ if (isr == NULL) - panic("esp_hdrsiz: NULL was passed.\n"); + panic("esp_hdrsiz: NULL was passed."); sav = isr->sav; diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index e858587..d964b58 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2627,7 +2627,7 @@ nolladdropt:; * and truncates if not. */ if (m0->m_next || m0->m_pkthdr.len != m0->m_len) - panic("assumption failed in %s:%d\n", __FILE__, __LINE__); + panic("assumption failed in %s:%d", __FILE__, __LINE__); if (len - sizeof(*nd_opt_rh) < m0->m_pkthdr.len) { /* not enough room, truncate */ diff --git a/sys/netinet6/in6_cksum.c b/sys/netinet6/in6_cksum.c index 170fe2e..049c60d 100644 --- a/sys/netinet6/in6_cksum.c +++ b/sys/netinet6/in6_cksum.c @@ -103,7 +103,7 @@ in6_cksum(m, nxt, off, len) #if 0 int srcifid = 0, dstifid = 0; #endif - struct ip6_hdr *ip6; + struct ip6_hdr *ip6; union { u_int16_t phs[4]; struct { @@ -123,7 +123,7 @@ in6_cksum(m, nxt, off, len) /* sanity check */ if (m->m_pkthdr.len < off + len) { - panic("in6_cksum: mbuf len (%d) < off+len (%d+%d)\n", + panic("in6_cksum: mbuf len (%d) < off+len (%d+%d)", m->m_pkthdr.len, off, len); } @@ -236,7 +236,7 @@ in6_cksum(m, nxt, off, len) /* * Lastly calculate a summary of the rest of mbufs. */ - + for (;m && len; m = m->m_next) { if (m->m_len == 0) continue; @@ -308,7 +308,7 @@ in6_cksum(m, nxt, off, len) s_util.c[0] = *(char *)w; } if (len) - panic("in6_cksum: out of data\n"); + panic("in6_cksum: out of data"); if (mlen == -1) { /* The last mbuf has odd # of bytes. Follow the standard (the odd byte may be shifted left by 8 bits diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 6587dea..6ae18f0 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -247,7 +247,7 @@ ipsec4_getpolicybypcb(m, dir, inp, error) /* sanity check */ if (m == NULL || inp == NULL || error == NULL) - panic("ipsec4_getpolicybysock: NULL pointer was passed.\n"); + panic("ipsec4_getpolicybysock: NULL pointer was passed."); /* set spidx in pcb */ #ifdef INET6 @@ -262,7 +262,7 @@ ipsec4_getpolicybypcb(m, dir, inp, error) /* sanity check */ if (pcbsp == NULL) - panic("ipsec4_getpolicybysock: pcbsp is NULL.\n"); + panic("ipsec4_getpolicybysock: pcbsp is NULL."); switch (dir) { case IPSEC_DIR_INBOUND: @@ -272,12 +272,12 @@ ipsec4_getpolicybypcb(m, dir, inp, error) currsp = pcbsp->sp_out; break; default: - panic("ipsec4_getpolicybysock: illegal direction.\n"); + panic("ipsec4_getpolicybysock: illegal direction."); } /* sanity check */ if (currsp == NULL) - panic("ipsec4_getpolicybysock: currsp is NULL.\n"); + panic("ipsec4_getpolicybysock: currsp is NULL."); /* when privilieged socket */ if (pcbsp->priv) { @@ -383,7 +383,7 @@ ipsec4_getpolicybysock(m, dir, so, error) { if (so == NULL) - panic("ipsec4_getpolicybysock: NULL pointer was passed.\n"); + panic("ipsec4_getpolicybysock: NULL pointer was passed."); return (ipsec4_getpolicybypcb(m, dir, sotoinpcb(so), error)); } @@ -408,7 +408,7 @@ ipsec4_getpolicybyaddr(m, dir, flag, error) /* sanity check */ if (m == NULL || error == NULL) - panic("ipsec4_getpolicybyaddr: NULL pointer was passed.\n"); + panic("ipsec4_getpolicybyaddr: NULL pointer was passed."); { struct secpolicyindex spidx; @@ -471,11 +471,11 @@ ipsec6_getpolicybypcb(m, dir, inp, error) /* sanity check */ if (m == NULL || inp == NULL || error == NULL) - panic("ipsec6_getpolicybysock: NULL pointer was passed.\n"); + panic("ipsec6_getpolicybysock: NULL pointer was passed."); #ifdef DIAGNOSTIC if ((inp->inp_vflag & INP_IPV6PROTO) == 0) - panic("ipsec6_getpolicybysock: socket domain != inet6\n"); + panic("ipsec6_getpolicybysock: socket domain != inet6"); #endif /* set spidx in pcb */ @@ -484,7 +484,7 @@ ipsec6_getpolicybypcb(m, dir, inp, error) /* sanity check */ if (pcbsp == NULL) - panic("ipsec6_getpolicybysock: pcbsp is NULL.\n"); + panic("ipsec6_getpolicybysock: pcbsp is NULL."); switch (dir) { case IPSEC_DIR_INBOUND: @@ -494,12 +494,12 @@ ipsec6_getpolicybypcb(m, dir, inp, error) currsp = pcbsp->sp_out; break; default: - panic("ipsec6_getpolicybysock: illegal direction.\n"); + panic("ipsec6_getpolicybysock: illegal direction."); } /* sanity check */ if (currsp == NULL) - panic("ipsec6_getpolicybysock: currsp is NULL.\n"); + panic("ipsec6_getpolicybysock: currsp is NULL."); /* when privilieged socket */ if (pcbsp->priv) { @@ -606,7 +606,7 @@ ipsec6_getpolicybysock(m, dir, so, error) { if (so == NULL) - panic("ipsec6_getpolicybysock: NULL pointer was passed.\n"); + panic("ipsec6_getpolicybysock: NULL pointer was passed."); return (ipsec6_getpolicybypcb(m, dir, sotoin6pcb(so), error)); } @@ -637,7 +637,7 @@ ipsec6_getpolicybyaddr(m, dir, flag, error) /* sanity check */ if (m == NULL || error == NULL) - panic("ipsec6_getpolicybyaddr: NULL pointer was passed.\n"); + panic("ipsec6_getpolicybyaddr: NULL pointer was passed."); { struct secpolicyindex spidx; @@ -697,7 +697,7 @@ ipsec_setspidx_mbuf(spidx, dir, family, m, needport) /* sanity check */ if (spidx == NULL || m == NULL) - panic("ipsec_setspidx_mbuf: NULL pointer was passed.\n"); + panic("ipsec_setspidx_mbuf: NULL pointer was passed."); bzero(spidx, sizeof(*spidx)); @@ -724,11 +724,11 @@ ipsec4_setspidx_inpcb(m, pcb) /* sanity check */ if (pcb == NULL) - panic("ipsec4_setspidx_inpcb: no PCB found.\n"); + panic("ipsec4_setspidx_inpcb: no PCB found."); if (pcb->inp_sp == NULL) - panic("ipsec4_setspidx_inpcb: no inp_sp found.\n"); + panic("ipsec4_setspidx_inpcb: no inp_sp found."); if (pcb->inp_sp->sp_out == NULL || pcb->inp_sp->sp_in == NULL) - panic("ipsec4_setspidx_inpcb: no sp_in/out found.\n"); + panic("ipsec4_setspidx_inpcb: no sp_in/out found."); bzero(&pcb->inp_sp->sp_in->spidx, sizeof(*spidx)); bzero(&pcb->inp_sp->sp_out->spidx, sizeof(*spidx)); @@ -764,11 +764,11 @@ ipsec6_setspidx_in6pcb(m, pcb) /* sanity check */ if (pcb == NULL) - panic("ipsec6_setspidx_in6pcb: no PCB found.\n"); + panic("ipsec6_setspidx_in6pcb: no PCB found."); if (pcb->in6p_sp == NULL) - panic("ipsec6_setspidx_in6pcb: no in6p_sp found.\n"); + panic("ipsec6_setspidx_in6pcb: no in6p_sp found."); if (pcb->in6p_sp->sp_out == NULL || pcb->in6p_sp->sp_in == NULL) - panic("ipsec6_setspidx_in6pcb: no sp_in/out found.\n"); + panic("ipsec6_setspidx_in6pcb: no sp_in/out found."); bzero(&pcb->in6p_sp->sp_in->spidx, sizeof(*spidx)); bzero(&pcb->in6p_sp->sp_out->spidx, sizeof(*spidx)); @@ -813,7 +813,7 @@ ipsec_setspidx(m, spidx, needport) int error; if (m == NULL) - panic("ipsec_setspidx: m == 0 passed.\n"); + panic("ipsec_setspidx: m == 0 passed."); /* * validate m->m_pkthdr.len. we see incorrect length if we @@ -896,9 +896,9 @@ ipsec4_get_ulp(m, spidx, needport) /* sanity check */ if (m == NULL) - panic("ipsec4_get_ulp: NULL pointer was passed.\n"); + panic("ipsec4_get_ulp: NULL pointer was passed."); if (m->m_pkthdr.len < sizeof(ip)) - panic("ipsec4_get_ulp: too short\n"); + panic("ipsec4_get_ulp: too short"); /* set default */ spidx->ul_proto = IPSEC_ULPROTO_ANY; @@ -1004,7 +1004,7 @@ ipsec6_get_ulp(m, spidx, needport) /* sanity check */ if (m == NULL) - panic("ipsec6_get_ulp: NULL pointer was passed.\n"); + panic("ipsec6_get_ulp: NULL pointer was passed."); KEYDEBUG(KEYDEBUG_IPSEC_DUMP, printf("ipsec6_get_ulp:\n"); kdebug_mbuf(m)); @@ -1117,7 +1117,7 @@ ipsec_init_policy(so, pcb_sp) /* sanity check. */ if (so == NULL || pcb_sp == NULL) - panic("ipsec_init_policy: NULL pointer was passed.\n"); + panic("ipsec_init_policy: NULL pointer was passed."); new = ipsec_newpcbpolicy(); if (new == NULL) { @@ -1358,7 +1358,7 @@ ipsec4_get_policy(inp, request, len, mp) if (inp == NULL || request == NULL || mp == NULL) return EINVAL; if (inp->inp_sp == NULL) - panic("policy in PCB is NULL\n"); + panic("policy in PCB is NULL"); if (len < sizeof(*xpl)) return EINVAL; xpl = (struct sadb_x_policy *)request; @@ -1387,7 +1387,7 @@ ipsec4_delete_pcbpolicy(inp) { /* sanity check. */ if (inp == NULL) - panic("ipsec4_delete_pcbpolicy: NULL pointer was passed.\n"); + panic("ipsec4_delete_pcbpolicy: NULL pointer was passed."); if (inp->inp_sp == NULL) return 0; @@ -1458,7 +1458,7 @@ ipsec6_get_policy(in6p, request, len, mp) if (in6p == NULL || request == NULL || mp == NULL) return EINVAL; if (in6p->in6p_sp == NULL) - panic("policy in PCB is NULL\n"); + panic("policy in PCB is NULL"); if (len < sizeof(*xpl)) return EINVAL; xpl = (struct sadb_x_policy *)request; @@ -1486,7 +1486,7 @@ ipsec6_delete_pcbpolicy(in6p) { /* sanity check. */ if (in6p == NULL) - panic("ipsec6_delete_pcbpolicy: NULL pointer was passed.\n"); + panic("ipsec6_delete_pcbpolicy: NULL pointer was passed."); if (in6p->in6p_sp == NULL) return 0; @@ -1521,10 +1521,10 @@ ipsec_get_reqlevel(isr) /* sanity check */ if (isr == NULL || isr->sp == NULL) - panic("ipsec_get_reqlevel: NULL pointer is passed.\n"); + panic("ipsec_get_reqlevel: NULL pointer is passed."); if (((struct sockaddr *)&isr->sp->spidx.src)->sa_family != ((struct sockaddr *)&isr->sp->spidx.dst)->sa_family) - panic("ipsec_get_reqlevel: family mismatched.\n"); + panic("ipsec_get_reqlevel: family mismatched."); /* XXX note that we have ipseclog() expanded here - code sync issue */ #define IPSEC_CHECK_DEFAULT(lev) \ @@ -1557,7 +1557,7 @@ ipsec_get_reqlevel(isr) break; #endif /* INET6 */ default: - panic("key_get_reqlevel: Unknown family. %d\n", + panic("key_get_reqlevel: Unknown family. %d", ((struct sockaddr *)&isr->sp->spidx.src)->sa_family); } @@ -1587,7 +1587,7 @@ ipsec_get_reqlevel(isr) break; default: panic("ipsec_get_reqlevel: " - "Illegal protocol defined %u\n", + "Illegal protocol defined %u", isr->saidx.proto); } break; @@ -1601,7 +1601,7 @@ ipsec_get_reqlevel(isr) break; default: - panic("ipsec_get_reqlevel: Illegal IPsec level %u\n", + panic("ipsec_get_reqlevel: Illegal IPsec level %u", isr->level); } @@ -1640,7 +1640,7 @@ ipsec_in_reject(sp, m) case IPSEC_POLICY_ENTRUST: default: - panic("ipsec_hdrsiz: Invalid policy found. %d\n", sp->policy); + panic("ipsec_hdrsiz: Invalid policy found. %d", sp->policy); } need_auth = 0; @@ -1821,7 +1821,7 @@ ipsec_hdrsiz(sp) case IPSEC_POLICY_ENTRUST: default: - panic("ipsec_hdrsiz: Invalid policy found. %d\n", sp->policy); + panic("ipsec_hdrsiz: Invalid policy found. %d", sp->policy); } siz = 0; @@ -2184,7 +2184,7 @@ ipsec_chkreplay(seq, sav) /* sanity check */ if (sav == NULL) - panic("ipsec_chkreplay: NULL pointer was passed.\n"); + panic("ipsec_chkreplay: NULL pointer was passed."); replay = sav->replay; @@ -2243,7 +2243,7 @@ ipsec_updatereplay(seq, sav) /* sanity check */ if (sav == NULL) - panic("ipsec_chkreplay: NULL pointer was passed.\n"); + panic("ipsec_chkreplay: NULL pointer was passed."); replay = sav->replay; @@ -2417,7 +2417,7 @@ ipsec_logsastr(sav) /* validity check */ if (((struct sockaddr *)&sav->sah->saidx.src)->sa_family != ((struct sockaddr *)&sav->sah->saidx.dst)->sa_family) - panic("ipsec_logsastr: family mismatched.\n"); + panic("ipsec_logsastr: family mismatched."); p = buf; snprintf(buf, sizeof(buf), "SA(SPI=%u ", (u_int32_t)ntohl(sav->spi)); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index b14fc24..f2f09f4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -288,9 +288,9 @@ nd6_option(ndopts) int olen; if (!ndopts) - panic("ndopts == NULL in nd6_option\n"); + panic("ndopts == NULL in nd6_option"); if (!ndopts->nd_opts_last) - panic("uninitialized ndopts in nd6_option\n"); + panic("uninitialized ndopts in nd6_option"); if (!ndopts->nd_opts_search) return NULL; if (ndopts->nd_opts_done) @@ -340,9 +340,9 @@ nd6_options(ndopts) int i = 0; if (!ndopts) - panic("ndopts == NULL in nd6_options\n"); + panic("ndopts == NULL in nd6_options"); if (!ndopts->nd_opts_last) - panic("uninitialized ndopts in nd6_options\n"); + panic("uninitialized ndopts in nd6_options"); if (!ndopts->nd_opts_search) return 0; @@ -454,12 +454,12 @@ nd6_timer(ignored_arg) /* sanity check */ if (!rt) - panic("rt=0 in nd6_timer(ln=%p)\n", ln); + panic("rt=0 in nd6_timer(ln=%p)", ln); if (rt->rt_llinfo && (struct llinfo_nd6 *)rt->rt_llinfo != ln) - panic("rt_llinfo(%p) is not equal to ln(%p)\n", + panic("rt_llinfo(%p) is not equal to ln(%p)", rt->rt_llinfo, ln); if (!dst) - panic("dst=0 in nd6_timer(ln=%p)\n", ln); + panic("dst=0 in nd6_timer(ln=%p)", ln); switch (ln->ln_state) { case ND6_LLINFO_INCOMPLETE: -- cgit v1.1