From 0831ea2ee53634a68952203a73daf221f7cd6be6 Mon Sep 17 00:00:00 2001 From: rwatson Date: Fri, 13 Jan 2006 23:47:55 +0000 Subject: 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 --- sys/netipx/ipx_input.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'sys/netipx') diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index 7852e2b..9631b74 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -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 -- cgit v1.1