summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2002-06-07 16:18:02 +0000
committeritojun <itojun@openbsd.org>2002-06-07 16:18:02 +0000
commit25a14d70f31555173ff4dfc3dac22c086c401a45 (patch)
tree3c9958b0fba1988674a8daa05f9efa33586d0e3d /sys/netinet/tcp_input.c
parenttypo (diff)
downloadwireguard-openbsd-25a14d70f31555173ff4dfc3dac22c086c401a45.tar.xz
wireguard-openbsd-25a14d70f31555173ff4dfc3dac22c086c401a45.zip
avoid is_ipv6 construct. a step towards IPv4-less kernel
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 3db4bcdcda2..a307b6ac266 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.115 2002/06/07 15:51:54 itojun Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.116 2002/06/07 16:18:02 itojun Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -2946,7 +2946,6 @@ tcp_mss(tp, offer)
struct ifnet *ifp;
int mss, mssopt;
int iphlen;
- int is_ipv6 = 0;
struct inpcb *inp;
inp = tp->t_inpcb;
@@ -2964,7 +2963,6 @@ tcp_mss(tp, offer)
#ifdef INET6
case AF_INET6:
iphlen = sizeof(struct ip6_hdr);
- is_ipv6 = 1;
break;
#endif
case AF_INET:
@@ -2997,14 +2995,14 @@ tcp_mss(tp, offer)
goto out;
else if (ifp->if_flags & IFF_LOOPBACK)
mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
- else if (!is_ipv6) {
+ 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))
mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
}
#ifdef INET6
- else if (is_ipv6) {
+ else if (tp->pf == AF_INET6) {
/*
* for IPv6, path MTU discovery is always turned on,
* or the node must use packet size <= 1280.