MCPcopy Create free account
hub / github.com/F-Stack/f-stack / in6_get_tmpifid

Function in6_get_tmpifid

freebsd/netinet6/in6_ifattach.c:804–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802}
803
804int
805in6_get_tmpifid(struct ifnet *ifp, u_int8_t *retbuf,
806 const u_int8_t *baseid, int generate)
807{
808 u_int8_t nullbuf[8];
809 struct nd_ifinfo *ndi = ND_IFINFO(ifp);
810
811 bzero(nullbuf, sizeof(nullbuf));
812 if (bcmp(ndi->randomid, nullbuf, sizeof(nullbuf)) == 0) {
813 /* we've never created a random ID. Create a new one. */
814 generate = 1;
815 }
816
817 if (generate) {
818 bcopy(baseid, ndi->randomseed1, sizeof(ndi->randomseed1));
819
820 /* generate_tmp_ifid will update seedn and buf */
821 (void)generate_tmp_ifid(ndi->randomseed0, ndi->randomseed1,
822 ndi->randomid);
823 }
824 bcopy(ndi->randomid, retbuf, 8);
825
826 return (0);
827}
828
829void
830in6_tmpaddrtimer(void *arg)

Callers 1

in6_tmpifaddFunction · 0.85

Calls 2

bzeroFunction · 0.85
generate_tmp_ifidFunction · 0.85

Tested by

no test coverage detected