Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet Refactor tcp_mtudisc
details: https://anonhg.NetBSD.org/src/rev/f7f38a57a28a
branches: trunk
changeset: 340467:f7f38a57a28a
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Mon Sep 07 01:56:50 2015 +0000
description:
Refactor tcp_mtudisc
No functional change.
diffstat:
sys/netinet/tcp_subr.c | 60 +++++++++++++++++++++++++------------------------
1 files changed, 31 insertions(+), 29 deletions(-)
diffs (89 lines):
diff -r 31adc490dad1 -r f7f38a57a28a sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c Mon Sep 07 01:18:27 2015 +0000
+++ b/sys/netinet/tcp_subr.c Mon Sep 07 01:56:50 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_subr.c,v 1.263 2015/08/24 22:21:26 pooka Exp $ */
+/* $NetBSD: tcp_subr.c,v 1.264 2015/09/07 01:56:50 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.263 2015/08/24 22:21:26 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.264 2015/09/07 01:56:50 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1768,41 +1768,43 @@
tcp_mtudisc(struct inpcb *inp, int errno)
{
struct tcpcb *tp = intotcpcb(inp);
- struct rtentry *rt = in_pcbrtentry(inp);
+ struct rtentry *rt;
- if (tp != 0) {
- if (rt != 0) {
- /*
- * If this was not a host route, remove and realloc.
- */
- if ((rt->rt_flags & RTF_HOST) == 0) {
- in_rtchange(inp, errno);
- if ((rt = in_pcbrtentry(inp)) == 0)
- return;
- }
+ if (tp == NULL)
+ return;
- /*
- * Slow start out of the error condition. We
- * use the MTU because we know it's smaller
- * than the previously transmitted segment.
- *
- * Note: This is more conservative than the
- * suggestion in draft-floyd-incr-init-win-03.
- */
- if (rt->rt_rmx.rmx_mtu != 0)
- tp->snd_cwnd =
- TCP_INITIAL_WINDOW(tcp_init_win,
- rt->rt_rmx.rmx_mtu);
+ rt = in_pcbrtentry(inp);
+ if (rt != NULL) {
+ /*
+ * If this was not a host route, remove and realloc.
+ */
+ if ((rt->rt_flags & RTF_HOST) == 0) {
+ in_rtchange(inp, errno);
+ if ((rt = in_pcbrtentry(inp)) == NULL)
+ return;
}
/*
- * Resend unacknowledged packets.
+ * Slow start out of the error condition. We
+ * use the MTU because we know it's smaller
+ * than the previously transmitted segment.
+ *
+ * Note: This is more conservative than the
+ * suggestion in draft-floyd-incr-init-win-03.
*/
- tp->snd_nxt = tp->sack_newdata = tp->snd_una;
- tcp_output(tp);
+ if (rt->rt_rmx.rmx_mtu != 0)
+ tp->snd_cwnd =
+ TCP_INITIAL_WINDOW(tcp_init_win,
+ rt->rt_rmx.rmx_mtu);
}
+
+ /*
+ * Resend unacknowledged packets.
+ */
+ tp->snd_nxt = tp->sack_newdata = tp->snd_una;
+ tcp_output(tp);
}
-#endif
+#endif /* INET */
#ifdef INET6
/*
Home |
Main Index |
Thread Index |
Old Index