All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] tls: Add SOL_TLS to uapi
@ 2019-03-21 14:29 Boris Pismenny
  2019-03-22 14:24 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Pismenny @ 2019-03-21 14:29 UTC (permalink / raw)
  To: davejwatson, borisp, aviadye, john.fastabend, daniel, netdev

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.

Signed-off-by: Boris Pismenny <borisp@mellanox.com>
---
v1: update commit message
---
 include/uapi/linux/tls.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/tls.h b/include/uapi/linux/tls.h
index 401d6f0..000a99e 100644
--- a/include/uapi/linux/tls.h
+++ b/include/uapi/linux/tls.h
@@ -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 */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] tls: Add SOL_TLS to uapi
  2019-03-21 14:29 [PATCH net-next v2] tls: Add SOL_TLS to uapi Boris Pismenny
@ 2019-03-22 14:24 ` David Miller
  2019-03-22 14:32   ` Boris Pismenny
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2019-03-22 14:24 UTC (permalink / raw)
  To: borisp; +Cc: davejwatson, aviadye, john.fastabend, daniel, netdev

From: Boris Pismenny <borisp@mellanox.com>
Date: Thu, 21 Mar 2019 16:29:02 +0200

> 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.
> 
> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
> ---
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] tls: Add SOL_TLS to uapi
  2019-03-22 14:24 ` David Miller
@ 2019-03-22 14:32   ` Boris Pismenny
  2019-03-23 22:13     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Pismenny @ 2019-03-22 14:32 UTC (permalink / raw)
  To: David Miller; +Cc: davejwatson, Aviad Yehezkel, john.fastabend, daniel, netdev



On 3/22/2019 3:24 PM, David Miller wrote:
> From: Boris Pismenny <borisp@mellanox.com>
> Date: Thu, 21 Mar 2019 16:29:02 +0200
> 
>> 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.
>>
>> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
>> ---
>> 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

> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] tls: Add SOL_TLS to uapi
  2019-03-22 14:32   ` Boris Pismenny
@ 2019-03-23 22:13     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-03-23 22:13 UTC (permalink / raw)
  To: borisp; +Cc: davejwatson, aviadye, john.fastabend, daniel, netdev

From: Boris Pismenny <borisp@mellanox.com>
Date: Fri, 22 Mar 2019 14:32:45 +0000

> 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
 ...
> Maybe libc maintainers need to be notified whenever linux/socket.h is 
> modified.

I think that is a much better way to handle this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-23 22:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 14:29 [PATCH net-next v2] tls: Add SOL_TLS to uapi Boris Pismenny
2019-03-22 14:24 ` David Miller
2019-03-22 14:32   ` Boris Pismenny
2019-03-23 22:13     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.