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

Function in6_matchlen

freebsd/netinet6/in6.c:1808–1825  ·  view source on GitHub ↗

* return length of part which dst and src are equal * hard coding... */

Source from the content-addressed store, hash-verified

1806 * hard coding...
1807 */
1808int
1809in6_matchlen(struct in6_addr *src, struct in6_addr *dst)
1810{
1811 int match = 0;
1812 u_char *s = (u_char *)src, *d = (u_char *)dst;
1813 u_char *lim = s + 16, r;
1814
1815 while (s < lim)
1816 if ((r = (*d++ ^ *s++)) != 0) {
1817 while (r < 128) {
1818 match++;
1819 r <<= 1;
1820 }
1821 break;
1822 } else
1823 match += 8;
1824 return match;
1825}
1826
1827/* XXX: to be scope conscious */
1828int

Callers 2

in6_ifawithifpFunction · 0.85
in6_selectsrcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected