diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-08 00:01:00 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-08 00:01:00 +0000 |
commit | da1ad99c527f87a2a7f8aa82bea424acca53475c (patch) | |
tree | a959237ed9c88191bc32d45b8fb6acd65e70a81a /sys | |
parent | 47c0d15fe9bdfb4fc889768664067cfb51ab4db2 (diff) |
on SIOCAIFADDR_IN6 check if sin6_len is sane. sync w/kame
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index ad600cb25b9..5e1110c107d 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.39 2002/06/07 15:00:54 itojun Exp $ */ +/* $OpenBSD: in6.c,v 1.40 2002/06/08 00:00:59 itojun Exp $ */ /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ /* @@ -452,7 +452,12 @@ in6_control(so, cmd, data, ifp, p) return(EADDRNOTAVAIL); /* FALLTHROUGH */ case SIOCAIFADDR_IN6: - if (ifra->ifra_addr.sin6_family != AF_INET6) + /* + * We always require users to specify a valid IPv6 address for + * the corresponding operation. + */ + if (ifra->ifra_addr.sin6_family != AF_INET6 || + ifra->ifra_addr.sin6_len != sizeof(struct sockaddr_in6)) return(EAFNOSUPPORT); if (!privileged) return(EPERM); |