summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/raw_ip6.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 2aa0881bbb4..933c0d25cab 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.9 2002/03/15 18:19:53 millert Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.10 2002/03/19 01:39:04 itojun Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -771,8 +771,18 @@ rip6_usrreq(so, req, m, nam, control, p)
error = ENOTCONN;
break;
}
+ if (nam->m_len != sizeof(tmp)) {
+ error = EINVAL;
+ break;
+ }
+
tmp = *mtod(nam, struct sockaddr_in6 *);
dst = &tmp;
+
+ if (dst->sin6_family != AF_INET6) {
+ error = EAFNOSUPPORT;
+ break;
+ }
}
#ifdef ENABLE_DEFAULT_SCOPE
if (dst->sin6_scope_id == 0) {