diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-04-25 09:44:39 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-04-25 09:44:39 +0000 |
commit | 197c46665bd3180e154c9942b9e12e355e820429 (patch) | |
tree | 6bdc5254e7d47545cbd122ce2ac6d610b9e91bb5 /sys/netinet/tcp_input.c | |
parent | 2fd1b2960b82fc7e005122375345eaf789b04b83 (diff) |
Kill in_localaddr(), one less usage of the global list of IPv4 addresses.
This function is used only once in our tree to optimize the size of the
MSS if the forward address correspond to a host on one of our subnets,
but only if ip.mutdisc is disable, which is not the default!
While here get rid of the "#ifdef RTV_MTU", it is here.
ok henning@, mikeb@, bluhm@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 14fc254a3d6..259877df1ae 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.275 2014/04/21 12:22:26 henning Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.276 2014/04/25 09:44:38 mpi Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -3040,7 +3040,6 @@ tcp_mss(struct tcpcb *tp, int offer) goto out; } -#ifdef RTV_MTU /* * if there's an mtu associated with the route and we support * path MTU discovery for the underlying protocol family, use it. @@ -3058,24 +3057,22 @@ tcp_mss(struct tcpcb *tp, int offer) */ mss = IPV6_MMTU - iphlen - sizeof(struct ip6_frag) - sizeof(struct tcphdr); - } else - mss = rt->rt_rmx.rmx_mtu - iphlen - sizeof(struct tcphdr); - } else -#endif /* RTV_MTU */ - if (!ifp) + } else { + mss = rt->rt_rmx.rmx_mtu - iphlen - + sizeof(struct tcphdr); + } + } else if (!ifp) { /* * ifp may be null and rmx_mtu may be zero in certain * v6 cases (e.g., if ND wasn't able to resolve the * destination host. */ goto out; - else if (ifp->if_flags & IFF_LOOPBACK) + } else if (ifp->if_flags & IFF_LOOPBACK) { mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr); - else if (tp->pf == AF_INET) { + } else if (tp->pf == AF_INET) { if (ip_mtudisc) mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr); - else if (inp && in_localaddr(inp->inp_faddr, inp->inp_rtableid)) - mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr); } #ifdef INET6 else if (tp->pf == AF_INET6) { |