<netinet6/ip6_mroute.h> undeclared identifier 'NBBY'

Victor Toni victor.toni at gmail.com
Tue May 3 19:41:15 UTC 2016


I'm trying to port the linux-based mcproxy (
https://github.com/mcproxy/mcproxy) to FreeBSD.
While trying to use <netinet6/ip6_mroute.h> instead of <linux/mroute6.h> I
encountered the following error:

--------------------------------------------------------------------
/usr/include/netinet6/ip6_mroute.h:90:39: error: use of undeclared
identifier 'NBBY'
        if_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)];
                                             ^
/usr/include/netinet6/ip6_mroute.h:83:36: note: expanded from macro
'NIFBITS'
#define NIFBITS (sizeof(if_mask) * NBBY)        /* bits per mask */
                                   ^
/usr/include/netinet6/ip6_mroute.h:86:33: note: expanded from macro
'howmany'
#define howmany(x, y)   (((x) + ((y) - 1)) / (y))
                                  ^
/usr/include/netinet6/ip6_mroute.h:90:39: error: use of undeclared
identifier 'NBBY'
/usr/include/netinet6/ip6_mroute.h:83:36: note: expanded from macro
'NIFBITS'
#define NIFBITS (sizeof(if_mask) * NBBY)        /* bits per mask */
                                   ^
/usr/include/netinet6/ip6_mroute.h:86:45: note: expanded from macro
'howmany'
#define howmany(x, y)   (((x) + ((y) - 1)) / (y))
                                              ^
--------------------------------------------------------------------

The error results from the missing definition of NBBY or rather the missing
include of <sys/param.h> where NBBY is defined.
My expectation would be that header files should be self-sufficient and as
such <netinet6/ip6_mroute.h> should include <sys/param.h> on its own.

What is the prefered way to work with header files in FreeBSD? Or is it a
bug in the header file?

Best regards,
Victor


More information about the freebsd-net mailing list