mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 07:31:11 +00:00
Remove dead code associated with 'mcopy' in ipx_forward(): at no point
are the contents of the forwarded mbuf ever copied into mcopy, so there's no need to have mcopy, conditionally look at mcopy, or conditionally free it. Noticed by: Coverity Prevent analysis tool MFC after: 3 days
This commit is contained in:
parent
bc03ea7f49
commit
bfcff7c78e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154320
|
@ -332,7 +332,6 @@ struct mbuf *m;
|
|||
{
|
||||
register struct ipx *ipx = mtod(m, struct ipx *);
|
||||
register int error;
|
||||
struct mbuf *mcopy = NULL;
|
||||
int agedelta = 1;
|
||||
int flags = IPX_FORWARDING;
|
||||
int ok_there = 0;
|
||||
|
@ -409,36 +408,12 @@ struct mbuf *m;
|
|||
ipx_printhost(&ipx->ipx_dna);
|
||||
printf(" hops %d\n", ipx->ipx_tc);
|
||||
}
|
||||
} else if (mcopy != NULL) {
|
||||
ipx = mtod(mcopy, struct ipx *);
|
||||
switch (error) {
|
||||
|
||||
case ENETUNREACH:
|
||||
case EHOSTDOWN:
|
||||
case EHOSTUNREACH:
|
||||
case ENETDOWN:
|
||||
case EPERM:
|
||||
ipxstat.ipxs_noroute++;
|
||||
break;
|
||||
|
||||
case EMSGSIZE:
|
||||
ipxstat.ipxs_mtutoosmall++;
|
||||
break;
|
||||
|
||||
case ENOBUFS:
|
||||
ipxstat.ipxs_odropped++;
|
||||
break;
|
||||
}
|
||||
mcopy = NULL;
|
||||
m_freem(m);
|
||||
}
|
||||
}
|
||||
cleanup:
|
||||
if (ok_there)
|
||||
ipx_undo_route(&ipx_droute);
|
||||
if (ok_back)
|
||||
ipx_undo_route(&ipx_sroute);
|
||||
if (mcopy != NULL)
|
||||
m_freem(mcopy);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue