Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet6/in6_ifattach.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet6/in6_ifattach.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.85 retrieving revision 1.85.12.2 diff -u -p -r1.85 -r1.85.12.2 --- src/sys/netinet6/in6_ifattach.c 2009/09/19 13:11:02 1.85 +++ src/sys/netinet6/in6_ifattach.c 2014/05/22 11:41:10 1.85.12.2 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_ifattach.c,v 1.85 2009/09/19 13:11:02 christos Exp $ */ +/* $NetBSD: in6_ifattach.c,v 1.85.12.2 2014/05/22 11:41:10 yamt Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.85 2009/09/19 13:11:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.85.12.2 2014/05/22 11:41:10 yamt Exp $"); #include #include @@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: in6_ifattach #include #include #include +#include #include #include @@ -177,7 +178,6 @@ generate_tmp_ifid(u_int8_t *seed0, const { MD5_CTX ctxt; u_int8_t seed[16], digest[16], nullbuf[8]; - u_int32_t val32; /* * interface ID for subnet anycast addresses. * XXX: we assume the unicast address range that requires IDs @@ -191,12 +191,7 @@ generate_tmp_ifid(u_int8_t *seed0, const /* If there's no hisotry, start with a random seed. */ memset(nullbuf, 0, sizeof(nullbuf)); if (memcmp(nullbuf, seed0, sizeof(nullbuf)) == 0) { - int i; - - for (i = 0; i < 2; i++) { - val32 = arc4random(); - memcpy(seed + sizeof(val32) * i, &val32, sizeof(val32)); - } + cprng_fast(seed, sizeof(seed)); } else memcpy(seed, seed0, 8); @@ -532,7 +527,7 @@ success: static int in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp) { - struct in6_ifaddr *ia; + struct in6_ifaddr *ia __diagused; struct in6_aliasreq ifra; struct nd_prefixctl pr0; int i, error; @@ -593,12 +588,7 @@ in6_ifattach_linklocal(struct ifnet *ifp } ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */ -#ifdef DIAGNOSTIC - if (!ia) { - panic("ia == NULL in in6_ifattach_linklocal"); - /* NOTREACHED */ - } -#endif + KASSERTMSG(ia, "ia == NULL in in6_ifattach_linklocal"); /* * Make the link-local prefix (fe80::/64%link) as on-link. @@ -889,7 +879,7 @@ in6_ifdetach(struct ifnet *ifp) rtrequest(RTM_DELETE, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&ia->ia_prefixmask, - rtflags, (struct rtentry **)0); + rtflags, NULL); } /* remove from the linked list */