svn commit: r318606 - head/sys/contrib/ipfilter/netinet

Cy Schubert cy at FreeBSD.org
Mon May 22 03:01:36 UTC 2017


Author: cy
Date: Mon May 22 03:01:35 2017
New Revision: 318606
URL: https://svnweb.freebsd.org/changeset/base/318606

Log:
  Refactor & compact struct i6addr_t #ifdef: remove redundant structure
  definintion when USE_INET6 is false.
  
  MFC after:	1 week

Modified:
  head/sys/contrib/ipfilter/netinet/ip_fil.h

Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_fil.h	Mon May 22 02:30:15 2017	(r318605)
+++ head/sys/contrib/ipfilter/netinet/ip_fil.h	Mon May 22 03:01:35 2017	(r318606)
@@ -143,11 +143,12 @@ typedef	int	(* lookupfunc_t) __P((struct
  * i6addr is used as a container for both IPv4 and IPv6 addresses, as well
  * as other types of objects, depending on its qualifier.
  */
-#ifdef	USE_INET6
 typedef	union	i6addr	{
 	u_32_t	i6[4];
 	struct	in_addr	in4;
+#ifdef	USE_INET6
 	struct	in6_addr in6;
+#endif
 	void	*vptr[2];
 	lookupfunc_t	lptr[2];
 	struct {
@@ -156,19 +157,6 @@ typedef	union	i6addr	{
 		int	name;
 	} i6un;
 } i6addr_t;
-#else
-typedef	union	i6addr	{
-	u_32_t	i6[4];
-	struct	in_addr	in4;
-	void	*vptr[2];
-	lookupfunc_t	lptr[2];
-	struct {
-		u_short	type;
-		u_short	subtype;
-		int	name;
-	} i6un;
-} i6addr_t;
-#endif
 
 #define in4_addr	in4.s_addr
 #define	iplookupnum	i6[1]


More information about the svn-src-head mailing list