Project

General

Profile

Bug #11187

net/if.h Breaks network applications

Added by Till Wegmüller 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

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

History

#1

Updated by Dan McDonald 5 months 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:

http://src.illumos.org/source/search?q=if_memmap&project=illumos-gate

and you can probably rename its type from "struct map" to "struct __map" or something like that.

Also available in: Atom PDF