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

Function nd6_llinfo_get_holdsrc

freebsd/netinet6/nd6.c:559–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557 * Set noinline to be dtrace-friendly
558 */
559static __noinline struct in6_addr *
560nd6_llinfo_get_holdsrc(struct llentry *ln, struct in6_addr *src)
561{
562 struct ip6_hdr hdr;
563 struct mbuf *m;
564
565 if (ln->la_hold == NULL)
566 return (NULL);
567
568 /*
569 * assume every packet in la_hold has the same IP header
570 */
571 m = ln->la_hold;
572 if (sizeof(hdr) > m->m_len)
573 return (NULL);
574
575 m_copydata(m, 0, sizeof(hdr), (caddr_t)&hdr);
576 *src = hdr.ip6_src;
577
578 return (src);
579}
580
581/*
582 * Checks if we need to switch from STALE state.

Callers 2

nd6_llinfo_timerFunction · 0.85
nd6_resolve_slowFunction · 0.85

Calls 1

m_copydataFunction · 0.85

Tested by

no test coverage detected