This is a discussion on in6_localaddr function in netinet6/in6.h within the mailing.openbsd.tech forums, part of the OpenBSD category; --> I noticed that in6_localaddr function is defined in netinet6/in6.h, but is not implemented anywhere. I also noticed that it ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I noticed that in6_localaddr function is defined in netinet6/in6.h, but is not implemented anywhere. I also noticed that it is currently not used anywhere, hence the build does not break, but when it is tried to use, "undefined reference" error is produced. Following is patch (from freebsd) for the same. $ sudo cvs diff cvs server: Diffing . Index: in6.c ================================================== ================= RCS file: /cvs/src/sys/netinet6/in6.c,v retrieving revision 1.77 diff -u -p -r1.77 in6.c - --- in6.c 11 Jun 2008 19:00:50 -0000 1.77 +++ in6.c 8 Jul 2008 02:04:25 -0000 @@ -2602,3 +2602,20 @@ in6_domifdetach(struct ifnet *ifp, void ~ free(ext->icmp6_ifstat, M_IFADDR); ~ free(ext, M_IFADDR); ~ } + +int +in6_localaddr(struct in6_addr *in6) +{ + struct in6_ifaddr *ia; + + if (IN6_IS_ADDR_LOOPBACK(in6) || IN6_IS_ADDR_LINKLOCAL(in6)) + return 1; + + for (ia = in6_ifaddr; ia; ia = ia->ia_next) + if (IN6_ARE_MASKED_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr, + &ia->ia_prefixmask.sin6_addr)) + return 1; + + + return 0; +} |