net/if.h Breaks network applications
We have recently talked with the People from Internet Systems Consortium (ISC) about using net/if.h in userland applications
One feedback from that has been that the structure names in net/if.h break a lot of C++ applications due to namespace pollution.
Their suggestion was to fixup the defines so that only safe names are exported.
The discussion is located here. https://gitlab.isc.org/isc-projects/kea/issues/631#note_60457
Updated by Dan McDonald about 1 year ago
We've had to make other files (more standards-y) C++-happy. There may even be illumos commit histories on some, which you can use as a basis for this fix.
net/if.h is there, BTW, solely for portability of network applications. "struct ifnet" for example is MOSTLY vestigal from BSD, but some portions of code still use it.
You should take an inventory of net/if.h, but for example, the "map" keyword-using structure only appears in the header itself:
and you can probably rename its type from "struct map" to "struct __map" or something like that.