svn commit: r282355 - head/sys/net
Gleb Smirnoff
glebius at FreeBSD.org
Sat May 2 20:37:41 UTC 2015
Author: glebius
Date: Sat May 2 20:37:40 2015
New Revision: 282355
URL: https://svnweb.freebsd.org/changeset/base/282355
Log:
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>
Modified:
head/sys/net/if_types.h
Modified: head/sys/net/if_types.h
==============================================================================
--- head/sys/net/if_types.h Sat May 2 20:31:27 2015 (r282354)
+++ head/sys/net/if_types.h Sat May 2 20:37:40 2015 (r282355)
@@ -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_ */
More information about the svn-src-all
mailing list