summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorjtl <jtl@FreeBSD.org>2016-03-07 14:59:49 +0000
committerjtl <jtl@FreeBSD.org>2016-03-07 14:59:49 +0000
commita23cd2fa7916c847b6b676649d0386c9d23af23c (patch)
tree53af6ebfdd00bbe3e19afde4a9a7a070bc944ecc /sys/netinet
parent5300ebacd8e44f0a4bb1c2b401328041708f17e6 (diff)
downloadFreeBSD-src-a23cd2fa7916c847b6b676649d0386c9d23af23c.zip
FreeBSD-src-a23cd2fa7916c847b6b676649d0386c9d23af23c.tar.gz
Some cleanup in tcp_respond() in preparation for another change:
- Reorder variables by size - Move initializer closer to where it is used - Remove unneeded variable Differential Revision: https://reviews.freebsd.org/D4808 Reviewed by: hiren MFC after: 2 weeks Sponsored by: Juniper Networks
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_subr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 620e446..aafdeaa 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -864,16 +864,14 @@ void
tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
tcp_seq ack, tcp_seq seq, int flags)
{
- int tlen;
- int win = 0;
+ struct inpcb *inp;
struct ip *ip;
struct tcphdr *nth;
#ifdef INET6
struct ip6_hdr *ip6;
int isipv6;
#endif /* INET6 */
- int ipflags = 0;
- struct inpcb *inp;
+ int tlen, win;
KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL"));
@@ -890,6 +888,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
} else
inp = NULL;
+ win = 0;
if (tp != NULL) {
if (!(flags & TH_RST)) {
win = sbspace(&inp->inp_socket->so_rcv);
@@ -1034,13 +1033,13 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m,
TCP_PROBE5(send, NULL, tp, mtod(m, const char *), tp, nth);
#ifdef INET6
if (isipv6)
- (void) ip6_output(m, NULL, NULL, ipflags, NULL, NULL, inp);
+ (void) ip6_output(m, NULL, NULL, 0, NULL, NULL, inp);
#endif /* INET6 */
#if defined(INET) && defined(INET6)
else
#endif
#ifdef INET
- (void) ip_output(m, NULL, NULL, ipflags, NULL, inp);
+ (void) ip_output(m, NULL, NULL, 0, NULL, inp);
#endif
}
OpenPOWER on IntegriCloud