Subject: tcp_input.c: simplify a v6 check slightly? [patch]
To: None <tech-net@NetBSD.org>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-net
Date: 05/19/2005 16:37:55
Browsing sys/netinet/tcp_input.c a bit more, I wonder if

 	#ifndef INET6
 	                if (inp == 0)
 	#else
 	                if (inp == 0 && in6p == 0)
 	#endif

shouldn't be changed to be a bit more readable by not using negative 
logic:

 	#ifdef INET6
 		if (inp == 0 && in6p == 0)
 	#else
 		if (inp == 0)
 	#endif

There is not change functionality, only make the code a bit easier to 
understand. The patch below does this. Any objections to commit?


  - Hubert


Index: tcp_input.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/tcp_input.c,v
retrieving revision 1.227
diff -u -r1.227 tcp_input.c
--- tcp_input.c	26 Apr 2005 05:37:45 -0000	1.227
+++ tcp_input.c	19 May 2005 14:27:36 -0000
@@ -1122,10 +1121,10 @@
  			}
  		}
  #endif
-#ifndef INET6
-		if (inp == 0)
-#else
+#ifdef INET6
  		if (inp == 0 && in6p == 0)
+#else
+		if (inp == 0)
  #endif
  		{
  			++tcpstat.tcps_noport;

-- 
Genervt von Viren und von Viren versandten Spam-Mails?  -> www.NetBSD.de
Fed up from viruses & virus-originated spam mail?       -> www.NetBSD.org