History

tcp: md5: add TCP_MD5SIG_EXT socket option to set a key address prefix

Replace first padding in the tcp_md5sig structure with a new flag field and address prefix length so it can be specified when configuring a new key for TCP MD5 signature. The tcpm_flags field will only be used if the socket option is TCP_MD5SIG_EXT to avoid breaking existing programs, and tcpm_prefixlen only when the TCP_MD5SIG_FLAG_PREFIX flag is set.

Ivan Delalande committed 9 years ago

Commit 8917a771 parent 67973185 files · +41 −15Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/tcp.h+8−3
@@ -117,7 +117,8 @@ enum { · 116 unmodified lines
117117 #define TCP_SAVED_SYN 28 /* Get SYN headers recorded for connection */
118118 #define TCP_REPAIR_WINDOW 29 /* Get/set window parameters */
119119 #define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect */
120−#define TCP_ULP 31 /* Attach a ULP to a TCP connection */
120+#define TCP_ULP 31 /* Attach a ULP to a TCP connection */
121+#define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions */
121122
122123 struct tcp_repair_opt {
123124 __u32 opt_code;
@@ -235,11 +236,15 @@ enum { · 111 unmodified lines
235236 /* for TCP_MD5SIG socket option */
236237 #define TCP_MD5SIG_MAXKEYLEN 80
237238
239+/* tcp_md5sig extension flags for TCP_MD5SIG_EXT */
240+#define TCP_MD5SIG_FLAG_PREFIX 1 /* address prefix length */
241+
238242 struct tcp_md5sig {
239243 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
240− __u16 __tcpm_pad1; /* zero */
244+ __u8 tcpm_flags; /* extension flags */
245+ __u8 tcpm_prefixlen; /* address prefix */
241246 __u16 tcpm_keylen; /* key length */
242− __u32 __tcpm_pad2; /* zero */
247+ __u32 __tcpm_pad; /* zero */
243248 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
244249 };
245250

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t