After r281643 an #ifdef IFT_FOO preprocessor directive returns false,

since types became a enum C type.  Some software uses such ifdefs to
determine whether an operating systems supports certain interface type.
Of course, such check is bogus. E.g. FreeBSD defines about 250 interface
types, but supports only around 20.
However, we need not upset such software so provide a set of defines. The
current set was taken to suffice the dhcpd.

Reported & tested by:	Guy Yur <guyyur gmail.com>
This commit is contained in:
Gleb Smirnoff 2015-05-02 20:37:40 +00:00
parent 0fa5aacd8b
commit a7dc945989
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282355

View File

@ -254,4 +254,20 @@ typedef enum {
IFT_PFLOG = 0xf6, /* PF packet filter logging */
IFT_PFSYNC = 0xf7, /* PF packet filter synchronization */
} ifType;
/*
* Some (broken) software uses #ifdef IFT_TYPE to check whether
* an operating systems supports certain interface type. Lack of
* ifdef leads to a piece of functionality compiled out.
*/
#ifndef BURN_BRIDGES
#define IFT_BRIDGE IFT_BRIDGE
#define IFT_PPP IFT_PPP
#define IFT_PROPVIRTUAL IFT_PROPVIRTUAL
#define IFT_L2VLAN IFT_L2VLAN
#define IFT_L3IPVLAN IFT_L3IPVLAN
#define IFT_IEEE1394 IFT_IEEE1394
#define IFT_INFINIBAND IFT_INFINIBAND
#endif
#endif /* !_NET_IF_TYPES_H_ */