aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGeorge V. Neville-Neil <gnn@FreeBSD.org>2005-04-14 11:41:23 +0000
committerGeorge V. Neville-Neil <gnn@FreeBSD.org>2005-04-14 11:41:23 +0000
commitc543ec4e348c6d9eaff558efbefe8de68a6125ed (patch)
treecf9f3eb643c397a4fbbef134683267d494e99ebd /sys
parenta6e97ccf7008e575b90a62f3abadd34ec1713d58 (diff)
downloadsrc-c543ec4e348c6d9eaff558efbefe8de68a6125ed.tar.gz
src-c543ec4e348c6d9eaff558efbefe8de68a6125ed.zip
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)
Notes
Notes: svn path=/head/; revision=145065
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/icmp6.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index a6f0f05a41a6..5ab4203ac35c 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -524,15 +524,6 @@ icmp6_input(mp, offp, proto)
const int maxlen = sizeof(*nip6) + sizeof(*nicmp6);
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);
n0len = n0->m_pkthdr.len; /* save for use below */
if (n)
@@ -1943,9 +1934,14 @@ icmp6_rip6_input(mp, off)
m->m_len <= MHLEN) {
MGET(n, M_DONTWAIT, m->m_type);
if (n != NULL) {
- m_dup_pkthdr(n, m, M_NOWAIT);
- bcopy(m->m_data, n->m_data, m->m_len);
- n->m_len = m->m_len;
+ if (m_dup_pkthdr(n, m, M_NOWAIT)) {
+ bcopy(m->m_data, n->m_data,
+ m->m_len);
+ n->m_len = m->m_len;
+ } else {
+ m_free(n);
+ n = NULL;
+ }
}
}
if (n != NULL ||
@@ -1983,12 +1979,16 @@ icmp6_rip6_input(mp, off)
MGET(n, M_DONTWAIT, m->m_type);
if (n != NULL) {
- m_dup_pkthdr(n, m, M_NOWAIT);
- bcopy(m->m_data, n->m_data, m->m_len);
- n->m_len = m->m_len;
-
- m_freem(m);
- m = n;
+ if (m_dup_pkthdr(n, m, M_NOWAIT)) {
+ bcopy(m->m_data, n->m_data, m->m_len);
+ n->m_len = m->m_len;
+
+ m_freem(m);
+ m = n;
+ } else {
+ m_freem(n);
+ n = NULL;
+ }
}
}
if (sbappendaddr(&last->in6p_socket->so_rcv,