Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 May 2015 20:37:40 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282355 - head/sys/net
Message-ID:  <201505022037.t42KbeZo083137@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505022037.t42KbeZo083137>