diff options
author | 2000-06-18 02:02:01 +0000 | |
---|---|---|
committer | 2000-06-18 02:02:01 +0000 | |
commit | d1fc83e847d110b60eec6b2a53dab17ebc267cb4 (patch) | |
tree | 5709be84b5415846a1580ad64733ef34e48bd58d /sys/netinet/tcp_usrreq.c | |
parent | correct indentation for IPV6_PORTRANGE (diff) | |
download | wireguard-openbsd-d1fc83e847d110b60eec6b2a53dab17ebc267cb4.tar.xz wireguard-openbsd-d1fc83e847d110b60eec6b2a53dab17ebc267cb4.zip |
for setsockopt/getsockopt, don't assume non-PF_INET6 address family as
PF_INET. we may see other family in the future... (pedant)
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index bbb22297121..4bf944242ca 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.40 2000/06/03 13:04:39 itojun Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.41 2000/06/18 02:02:01 itojun Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -552,12 +552,19 @@ tcp_ctloutput(op, so, level, optname, mp) tp = intotcpcb(inp); #endif /* INET6 */ if (level != IPPROTO_TCP) { + switch (so->so_proto->pr_domain->dom_family) { #ifdef INET6 - if (so->so_proto->pr_domain->dom_family == PF_INET6) + case PF_INET6: error = ip6_ctloutput(op, so, level, optname, mp); - else + break; #endif /* INET6 */ + case PF_INET: error = ip_ctloutput(op, so, level, optname, mp); + break; + default: + error = EAFNOSUPPORT; /*?*/ + break; + } splx(s); return (error); } |