diff options
author | hsu <hsu@FreeBSD.org> | 2002-12-20 11:16:52 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2002-12-20 11:16:52 +0000 |
commit | 3697a256483515b105a8cdfe0eb8157155e29bf8 (patch) | |
tree | 53a72ebb79c85215949ddabc7539cc8afde4e49d /sys/netinet | |
parent | 08218617f475dff61ed68f3d0803efe63c59525d (diff) | |
download | FreeBSD-src-3697a256483515b105a8cdfe0eb8157155e29bf8.zip FreeBSD-src-3697a256483515b105a8cdfe0eb8157155e29bf8.tar.gz |
Unravel a nested conditional.
Remove an unneeded local variable.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_input.c | 33 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 33 |
2 files changed, 24 insertions, 42 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index db17648..b424add 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -368,10 +368,6 @@ tcp_input(m, off0) short ostate = 0; #endif -#ifdef MAC - int error; -#endif - /* Grab info from MT_TAG mbufs prepended to the chain. */ for (;m && m->m_type == MT_TAG; m = m->m_next) { if (m->_m_tag_id == PACKET_TAG_IPFORWARD) @@ -660,27 +656,22 @@ findpcb: so = inp->inp_socket; #ifdef MAC - error = mac_check_socket_deliver(so, m); - if (error) + if (mac_check_socket_deliver(so, m)) goto drop; #endif - if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) { - struct in_conninfo inc; #ifdef TCPDEBUG - if (so->so_options & SO_DEBUG) { - ostate = tp->t_state; - if (isipv6) - bcopy((char *)ip6, (char *)tcp_saveipgen, - sizeof(*ip6)); - else - bcopy((char *)ip, (char *)tcp_saveipgen, - sizeof(*ip)); - tcp_savetcp = *th; - } + if (so->so_options & SO_DEBUG) { + ostate = tp->t_state; + if (isipv6) + bcopy((char *)ip6, (char *)tcp_saveipgen, sizeof(*ip6)); + else + bcopy((char *)ip, (char *)tcp_saveipgen, sizeof(*ip)); + tcp_savetcp = *th; + } #endif - /* skip if this isn't a listen socket */ - if ((so->so_options & SO_ACCEPTCONN) == 0) - goto after_listen; + if (so->so_options & SO_ACCEPTCONN) { + struct in_conninfo inc; + #ifdef INET6 inc.inc_isipv6 = isipv6; #endif diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index db17648..b424add 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -368,10 +368,6 @@ tcp_input(m, off0) short ostate = 0; #endif -#ifdef MAC - int error; -#endif - /* Grab info from MT_TAG mbufs prepended to the chain. */ for (;m && m->m_type == MT_TAG; m = m->m_next) { if (m->_m_tag_id == PACKET_TAG_IPFORWARD) @@ -660,27 +656,22 @@ findpcb: so = inp->inp_socket; #ifdef MAC - error = mac_check_socket_deliver(so, m); - if (error) + if (mac_check_socket_deliver(so, m)) goto drop; #endif - if (so->so_options & (SO_DEBUG|SO_ACCEPTCONN)) { - struct in_conninfo inc; #ifdef TCPDEBUG - if (so->so_options & SO_DEBUG) { - ostate = tp->t_state; - if (isipv6) - bcopy((char *)ip6, (char *)tcp_saveipgen, - sizeof(*ip6)); - else - bcopy((char *)ip, (char *)tcp_saveipgen, - sizeof(*ip)); - tcp_savetcp = *th; - } + if (so->so_options & SO_DEBUG) { + ostate = tp->t_state; + if (isipv6) + bcopy((char *)ip6, (char *)tcp_saveipgen, sizeof(*ip6)); + else + bcopy((char *)ip, (char *)tcp_saveipgen, sizeof(*ip)); + tcp_savetcp = *th; + } #endif - /* skip if this isn't a listen socket */ - if ((so->so_options & SO_ACCEPTCONN) == 0) - goto after_listen; + if (so->so_options & SO_ACCEPTCONN) { + struct in_conninfo inc; + #ifdef INET6 inc.inc_isipv6 = isipv6; #endif |