summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2015-11-20 10:45:29 +0000
committermpi <mpi@openbsd.org>2015-11-20 10:45:29 +0000
commit19a7ad2002278e8a2fa7727e5c647bf26d19111a (patch)
treeeb4352e2945aa4364b6229fa6043f8af29cf9c89 /sys/netinet/tcp_input.c
parentMake use if_get() and get rid of rt_ifp. (diff)
downloadwireguard-openbsd-19a7ad2002278e8a2fa7727e5c647bf26d19111a.tar.xz
wireguard-openbsd-19a7ad2002278e8a2fa7727e5c647bf26d19111a.zip
Make use if_get() and get rid of rt_ifp.
Tested by and ok sthen@, ok visa@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index e7a182f982e..19135acab03 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.308 2015/11/06 11:20:56 mpi Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.309 2015/11/20 10:45:29 mpi Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -2988,8 +2988,6 @@ tcp_mss(struct tcpcb *tp, int offer)
if (rt == NULL)
goto out;
- ifp = rt->rt_ifp;
-
switch (tp->pf) {
#ifdef INET6
case AF_INET6:
@@ -3004,6 +3002,7 @@ tcp_mss(struct tcpcb *tp, int offer)
goto out;
}
+ ifp = if_get(rt->rt_ifidx);
/*
* if there's an mtu associated with the route and we support
* path MTU discovery for the underlying protocol family, use it.
@@ -3025,7 +3024,7 @@ tcp_mss(struct tcpcb *tp, int offer)
mss = rt->rt_rmx.rmx_mtu - iphlen -
sizeof(struct tcphdr);
}
- } else if (!ifp) {
+ } else if (ifp == NULL) {
/*
* ifp may be null and rmx_mtu may be zero in certain
* v6 cases (e.g., if ND wasn't able to resolve the
@@ -3053,7 +3052,7 @@ tcp_mss(struct tcpcb *tp, int offer)
mssopt = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
mssopt = max(tcp_mssdflt, mssopt);
}
-
+ if_put(ifp);
out:
/*
* The current mss, t_maxseg, is initialized to the default value.