diff options
author | 2015-11-20 10:45:29 +0000 | |
---|---|---|
committer | 2015-11-20 10:45:29 +0000 | |
commit | 19a7ad2002278e8a2fa7727e5c647bf26d19111a (patch) | |
tree | eb4352e2945aa4364b6229fa6043f8af29cf9c89 /sys/netinet/tcp_input.c | |
parent | Make use if_get() and get rid of rt_ifp. (diff) | |
download | wireguard-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.c | 9 |
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. |