diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-01-09 04:39:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-01-09 04:39:16 +0000 |
commit | 6307978aa0c4c7d8479947ac2df5348208026d0c (patch) | |
tree | 21698c0b9a0e352a4336109d1e4fd6fd659667af /sys/netipx | |
parent | 55ecebbe93d0964d69daf99791347df8d121855e (diff) | |
download | FreeBSD-src-6307978aa0c4c7d8479947ac2df5348208026d0c.zip FreeBSD-src-6307978aa0c4c7d8479947ac2df5348208026d0c.tar.gz |
Eliminate jump to 'bad' label in order to clean up the ipx_input()
return/unwind path for locking work.
MFC after: 2 weeks
Diffstat (limited to 'sys/netipx')
-rw-r--r-- | sys/netipx/ipx_input.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index ad88885..596b275 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004 Robert N. M. Watson + * Copyright (c) 2004-2005 Robert N. M. Watson * Copyright (c) 1995, Mike Mitchell * Copyright (c) 1984, 1985, 1986, 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -143,8 +143,10 @@ ipxintr(struct mbuf *m) * If no IPX addresses have been set yet but the interfaces * are receiving, can't do anything with incoming packets yet. */ - if (ipx_ifaddr == NULL) - goto bad; + if (ipx_ifaddr == NULL) { + m_freem(m); + return; + } ipxstat.ipxs_total++; @@ -173,7 +175,8 @@ ipxintr(struct mbuf *m) */ if (m->m_pkthdr.len < len) { ipxstat.ipxs_tooshort++; - goto bad; + m_freem(m); + return; } if (m->m_pkthdr.len > len) { if (m->m_len == m->m_pkthdr.len) { @@ -185,7 +188,8 @@ ipxintr(struct mbuf *m) if (ipxcksum && ipx->ipx_sum != 0xffff) { if (ipx->ipx_sum != ipx_cksum(m, len)) { ipxstat.ipxs_badsum++; - goto bad; + m_freem(m); + return; } } @@ -197,8 +201,10 @@ ipxintr(struct mbuf *m) if (ipxnetbios) { ipx_output_type20(m); return; - } else - goto bad; + } else { + m_freem(m); + return; + } } /* @@ -267,12 +273,7 @@ ours: } ipx_input(m, ipxp); } else - goto bad; - - return; - -bad: - m_freem(m); + m_freem(m); } void |