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

Function nd6_dad_ns_output

freebsd/netinet6/nd6_nbr.c:1503–1533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1501}
1502
1503static void
1504nd6_dad_ns_output(struct dadq *dp)
1505{
1506 struct in6_ifaddr *ia = (struct in6_ifaddr *)dp->dad_ifa;
1507 struct ifnet *ifp = dp->dad_ifa->ifa_ifp;
1508 int i;
1509
1510 dp->dad_ns_tcount++;
1511 if ((ifp->if_flags & IFF_UP) == 0) {
1512 return;
1513 }
1514 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
1515 return;
1516 }
1517
1518 dp->dad_ns_ocount++;
1519 if (V_dad_enhanced != 0) {
1520 for (i = 0; i < ND_OPT_NONCE_LEN32; i++)
1521 dp->dad_nonce[i] = arc4random();
1522 /*
1523 * XXXHRS: Note that in the case that
1524 * DupAddrDetectTransmits > 1, multiple NS messages with
1525 * different nonces can be looped back in an unexpected
1526 * order. The current implementation recognizes only
1527 * the latest nonce on the sender side. Practically it
1528 * should work well in almost all cases.
1529 */
1530 }
1531 nd6_ns_output(ifp, NULL, NULL, &ia->ia_addr.sin6_addr,
1532 (uint8_t *)&dp->dad_nonce[0]);
1533}
1534
1535static void
1536nd6_dad_ns_input(struct ifaddr *ifa, struct nd_opt_nonce *ndopt_nonce)

Callers 1

nd6_dad_starttimerFunction · 0.85

Calls 2

nd6_ns_outputFunction · 0.85
arc4randomFunction · 0.50

Tested by

no test coverage detected