Thread (7 messages) flat view 7 messages, 3 authors, 2011-12-21

RE: [PATCH 1/1] tcp: Replace constants with #define macros

From: David Laight <hidden>
Date: 2011-12-20 10:28:59

 
quoted hunk ↗ jump to hunk
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7f59ee9..874b043 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -238,6 +238,11 @@ struct tcp_sack_block {
 	u32	end_seq;
 };
 
+/*These are used to set the sack_ok field in struct 
tcp_options_received */
+#define SACK_SEEN     (1 << 0)   /*1 = peer is SACK capable, */
+#define FACK_ENABLED  (1 << 1)   /*1 = FACK is enabled locally*/
+#define DSACK_SEEN    (1 << 2)   /*1 = DSACK was received from peer*/
+
Since that is a fairly public header, some namespace protection
might be sensible.
-	tcp_opt->sack_ok = (options >> 4) & 0x1;
+	tcp_opt->sack_ok = (options >> 4) & SACK_SEEN;
Looks to me like that 0x1 isn't SAC_SEEK! So this is now misleading.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help