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

Function ip6_lasthdr

freebsd/netinet6/ip6_input.c:1702–1724  ·  view source on GitHub ↗

* get offset for the last header in the chain. m will be kept untainted. */

Source from the content-addressed store, hash-verified

1700 * get offset for the last header in the chain. m will be kept untainted.
1701 */
1702int
1703ip6_lasthdr(const struct mbuf *m, int off, int proto, int *nxtp)
1704{
1705 int newoff;
1706 int nxt;
1707
1708 if (!nxtp) {
1709 nxt = -1;
1710 nxtp = &nxt;
1711 }
1712 while (1) {
1713 newoff = ip6_nexthdr(m, off, proto, nxtp);
1714 if (newoff < 0)
1715 return off;
1716 else if (newoff < off)
1717 return -1; /* invalid */
1718 else if (newoff == off)
1719 return newoff;
1720
1721 off = newoff;
1722 proto = *nxtp;
1723 }
1724}
1725
1726/*
1727 * System control for IP6

Callers 3

icmp6_errorFunction · 0.85
ipsec6_get_ulpFunction · 0.85

Calls 1

ip6_nexthdrFunction · 0.85

Tested by

no test coverage detected