Skip to contentSkip to conversation

tls: Add SOL_TLS to uapi

PATCH In review Boris Pismenny 2 participants 4 messages Mar 21, 2019 – Mar 23, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tls: Add SOL_TLS to uapi

User applications are forced to define the SOL_TLS manually at the moment, which is inappropriate. Add SOL_TLS to the uapi.

Other protocols handle this similarly. For example see SOL_TIPC.

---
v1: update commit message

---
 include/uapi/linux/tls.h | 4 ++++
 1 file changed, 4 insertions(+)
include/uapi/linux/tls.h +4 -0
index 401d6f0..000a99e 100644
@@ -36,6 +36,10 @@
 
 #include <linux/types.h>
 
+#ifndef SOL_TLS
+#define SOL_TLS                282
+#endif
+
 /* TLS socket options */
 #define TLS_TX			1	/* Set transmit parameters */
 #define TLS_RX			2	/* Set receive parameters */
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: Boris Pismenny <[email protected]>
Date: Thu, 21 Mar 2019 16:29:02 +0200

Quoted 8 lines

User applications are forced to define the SOL_TLS manually at the moment, which is inappropriate. Add SOL_TLS to the uapi.

Other protocols handle this similarly. For example see SOL_TIPC.

---
v1: update commit message

Where did this convention come from where we define SOL_* in linux/socket.h and then have to do this ifdef dance in the per-family UAPI header?

AF_ALG and AF_KCM never did this, but I see that AF_TIPC did.

There really has to be a better way.

#2 lore raw
Quoted 8 lines · David Miller

From: Boris Pismenny <[email protected]>
Date: Thu, 21 Mar 2019 16:29:02 +0200

Quoted 5 lines

User applications are forced to define the SOL_TLS manually at the moment, which is inappropriate. Add SOL_TLS to the uapi.

Other protocols handle this similarly. For example see SOL_TIPC.

Quoted 8 lines
Quoted 3 lines

---
v1: update commit message

Where did this convention come from where we define SOL_* in linux/socket.h and then have to do this ifdef dance in the per-family UAPI header?

The source for this is not known to me.
I've saw that this issue was mentioned and fixed in libc:
http://sourceware.org/ml/libc-alpha/2016-05/msg00322.html

Quoted 4 lines

AF_ALG and AF_KCM never did this, but I see that AF_TIPC did.

There really has to be a better way.

Maybe libc maintainers need to be notified whenever linux/socket.h is modified.