Refactor tcp_mtudisc

No functional change.
This commit is contained in:
ozaki-r 2015-09-07 01:56:50 +00:00
parent 6c5982b876
commit cac0e9c370
1 changed files with 31 additions and 29 deletions

View File

@ -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,16 +1768,19 @@ void
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 (tp == NULL)
return;
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)) == 0)
if ((rt = in_pcbrtentry(inp)) == NULL)
return;
}
@ -1801,8 +1804,7 @@ tcp_mtudisc(struct inpcb *inp, int errno)
tp->snd_nxt = tp->sack_newdata = tp->snd_una;
tcp_output(tp);
}
}
#endif
#endif /* INET */
#ifdef INET6
/*