1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Remove dead code which would never execute.

i.e. checking to see if a cluster was every less than 48 bytes,
    a rather unlikely case.

Check return value of m_dup_pkthdr() calls.

Found by: Coverity
Reviewed by: rwatson (mentor), Keiichi Shima (for Kame)
Approved by: rwatson (mentor)
This commit is contained in:
George V. Neville-Neil 2005-04-14 11:41:23 +00:00
parent a6e97ccf70
commit c543ec4e34
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145065

View File

@ -524,15 +524,6 @@ icmp6_input(mp, offp, proto)
const int maxlen = sizeof(*nip6) + sizeof(*nicmp6); const int maxlen = sizeof(*nip6) + sizeof(*nicmp6);
int n0len; int n0len;
/*
* Prepare an internal mbuf. m_pullup() doesn't
* always copy the length we specified.
*/
if (maxlen >= MCLBYTES) {
/* Give up remote */
m_freem(n0);
break;
}
MGETHDR(n, M_DONTWAIT, n0->m_type); MGETHDR(n, M_DONTWAIT, n0->m_type);
n0len = n0->m_pkthdr.len; /* save for use below */ n0len = n0->m_pkthdr.len; /* save for use below */
if (n) if (n)
@ -1943,9 +1934,14 @@ icmp6_rip6_input(mp, off)
m->m_len <= MHLEN) { m->m_len <= MHLEN) {
MGET(n, M_DONTWAIT, m->m_type); MGET(n, M_DONTWAIT, m->m_type);
if (n != NULL) { if (n != NULL) {
m_dup_pkthdr(n, m, M_NOWAIT); if (m_dup_pkthdr(n, m, M_NOWAIT)) {
bcopy(m->m_data, n->m_data, m->m_len); bcopy(m->m_data, n->m_data,
n->m_len = m->m_len; m->m_len);
n->m_len = m->m_len;
} else {
m_free(n);
n = NULL;
}
} }
} }
if (n != NULL || if (n != NULL ||
@ -1983,12 +1979,16 @@ icmp6_rip6_input(mp, off)
MGET(n, M_DONTWAIT, m->m_type); MGET(n, M_DONTWAIT, m->m_type);
if (n != NULL) { if (n != NULL) {
m_dup_pkthdr(n, m, M_NOWAIT); if (m_dup_pkthdr(n, m, M_NOWAIT)) {
bcopy(m->m_data, n->m_data, m->m_len); bcopy(m->m_data, n->m_data, m->m_len);
n->m_len = m->m_len; n->m_len = m->m_len;
m_freem(m); m_freem(m);
m = n; m = n;
} else {
m_freem(n);
n = NULL;
}
} }
} }
if (sbappendaddr(&last->in6p_socket->so_rcv, if (sbappendaddr(&last->in6p_socket->so_rcv,