-/* $OpenBSD: in.c,v 1.95 2014/04/10 13:47:21 mpi Exp $ */
+/* $OpenBSD: in.c,v 1.96 2014/04/25 09:44:38 mpi Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
int in_addhost(struct in_ifaddr *);
int in_scrubhost(struct in_ifaddr *);
-/* Return 1 if an internet address is for a directly connected host */
-int
-in_localaddr(struct in_addr in, u_int rdomain)
-{
- struct in_ifaddr *ia;
-
- rdomain = rtable_l2(rdomain);
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
- if (ia->ia_ifp->if_rdomain != rdomain)
- continue;
- if ((in.s_addr & ia->ia_netmask) == ia->ia_net)
- return (1);
- }
- return (0);
-}
-
/*
* Determine whether an IP address is in a reserved set of addresses
* that may not be forwarded, or whether datagrams to that destination
-/* $OpenBSD: in.h,v 1.107 2014/04/21 10:07:58 henning Exp $ */
+/* $OpenBSD: in.h,v 1.108 2014/04/25 09:44:38 mpi Exp $ */
/* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
/*
int in_canforward(struct in_addr);
int in_cksum(struct mbuf *, int);
int in4_cksum(struct mbuf *, u_int8_t, int, int);
-int in_localaddr(struct in_addr, u_int);
void in_proto_cksum_out(struct mbuf *, struct ifnet *);
void in_ifdetach(struct ifnet *);
int in_mask2len(struct in_addr *);
-/* $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 $ */
/*
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.
*/
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) {