jpirko / libndp

Neighbor Discovery library
GNU Lesser General Public License v2.1
39 stars 20 forks source link

Fails to build on FreeBSD #23

Open yurivict opened 1 year ago

yurivict commented 1 year ago
libndp.c:212:43: warning: incompatible pointer types passing 'struct sockaddr_in6 *' to parameter of type 'const struct sockaddr *' [-Wincompatible-pointer-types]
        ret = sendto(sockfd, buf, buflen, flags, &sin6, sizeof(sin6));
                                                 ^~~~~
/usr/include/sys/socket.h:702:42: note: passing argument to parameter here
            size_t, int, const struct sockaddr *, socklen_t);
                                                ^
libndp.c:295:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[0] = htonl(0xFF020000);
        ~~~~  ^
libndp.c:296:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[1] = 0;
        ~~~~  ^
libndp.c:297:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[2] = 0;
        ~~~~  ^
libndp.c:298:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[3] = htonl(0x1);
        ~~~~  ^
libndp.c:307:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[0] = htonl(0xFF020000);
        ~~~~  ^
libndp.c:308:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[1] = 0;
        ~~~~  ^
libndp.c:309:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[2] = 0;
        ~~~~  ^
libndp.c:310:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[3] = htonl(0x2);
        ~~~~  ^
libndp.c:319:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[0] = htonl(0xFF020000);
        ~~~~  ^
libndp.c:320:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[1] = 0;
        ~~~~  ^
libndp.c:321:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[2] = htonl(0x1);
        ~~~~  ^
libndp.c:322:8: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[3] = htonl(0xFF000000) | target->s6_addr32[3];
        ~~~~  ^
libndp.c:322:51: error: no member named 's6_addr32' in 'struct in6_addr'
        addr->s6_addr32[3] = htonl(0xFF000000) | target->s6_addr32[3];
                                                 ~~~~~~  ^
libndp.c:774:20: error: use of undeclared identifier 'SIOCGIFHWADDR'
        if (ioctl(sockfd, SIOCGIFHWADDR, &ifr) < 0) {
                          ^
libndp.c:780:19: error: no member named 'ifr_hwaddr' in 'struct ifreq'
        memcpy(ptr, &ifr.ifr_hwaddr.sa_data, sizeof(ifr.ifr_hwaddr.sa_data));
                     ~~~ ^
libndp.c:780:50: error: no member named 'ifr_hwaddr' in 'struct ifreq'
        memcpy(ptr, &ifr.ifr_hwaddr.sa_data, sizeof(ifr.ifr_hwaddr.sa_data));
                                                    ~~~ ^
libndp.c:979:43: error: use of undeclared identifier 'ND_RA_FLAG_HOME_AGENT'
        return msgra->ra->nd_ra_flags_reserved & ND_RA_FLAG_HOME_AGENT;
                                                 ^
libndp.c:993:38: error: use of undeclared identifier 'ND_RA_FLAG_HOME_AGENT'
                msgra->ra->nd_ra_flags_reserved |= ND_RA_FLAG_HOME_AGENT;
                                                   ^
libndp.c:995:39: error: use of undeclared identifier 'ND_RA_FLAG_HOME_AGENT'
                msgra->ra->nd_ra_flags_reserved &= ~ND_RA_FLAG_HOME_AGENT;
                                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

FreeBSD 13.1

arrowd commented 1 year ago

Made a port for this library: https://github.com/freebsd/freebsd-ports/commit/ceb716ddd375d47c6519e24ba4dcf63e1d0022d1