Re: [PATCH] TCP: Add support for TCP Stealth
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2015-01-01 19:06:57
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2015-01-01 19:06:57
On Wed, 31 Dec 2014 22:54:59 +0100 Julian Kirsch [off-list ref] wrote:
+#ifdef CONFIG_TCP_STEALTH
+/* Stealth TCP socket configuration */
+ struct {
+ #define TCP_STEALTH_MODE_AUTH BIT(0)
+ #define TCP_STEALTH_MODE_INTEGRITY BIT(1)
+ #define TCP_STEALTH_MODE_INTEGRITY_LEN BIT(2)
+ int mode;
+ u8 secret[MD5_MESSAGE_BYTES];
+ int integrity_len;
+ u16 integrity_hash;
+ struct skb_mstamp mstamp;
+ bool saw_tsval;
+ } stealth;
+#endifIf you want a bitfield, why not use a bitfield for mode? If you have to use masks, better to use u8 for mode. Integrity length should be unsigned since obviously negative values are not possible. Rearrange structure to save space. Lots of holes here.