kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Kernel TLS
@ 2019-11-29 19:36 Jeffrey Walton
  2019-11-29 19:46 ` Alexander Mihalicyn
  2019-11-29 19:48 ` Valentin Vidić
  0 siblings, 2 replies; 15+ messages in thread
From: Jeffrey Walton @ 2019-11-29 19:36 UTC (permalink / raw)
  To: kernelnewbies

Hi Everyone,

I'm trying to run through the example at
https://www.kernel.org/doc/html/latest/networking/tls.html#kernel-tls
.

I'm working on Fedora 31 x86_64 (fully patched). Running my program results in:

    $ ./ktls
    setsockopt failed, 2, No such file or directory

I observed:

    $ cat /proc/sys/net/ipv4/tcp_available_ulp
    $

Is there a way to enable ULP at boot? Or is this a kernel config
option? Or maybe I am doing something else wrong?

Below is the sample code.

Jeff

==============================

#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>

#include <sys/socket.h>
#include <sys/types.h>

#include <linux/tls.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>

int main()
{
    int sock = socket(AF_INET, SOCK_STREAM, 0);
    if (sock == -1)
    {
        printf("socket failed, %d, %s\n", errno, strerror(errno));
        return 1;
    }

    if (setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls")) == -1 )
    {
        printf("setsockopt failed, %d, %s\n", errno, strerror(errno));
        return 1;
    }

    close (sock);
    return 0;
}

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2019-11-30 13:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29 19:36 Kernel TLS Jeffrey Walton
2019-11-29 19:46 ` Alexander Mihalicyn
2019-11-29 19:48 ` Valentin Vidić
2019-11-29 19:57   ` Jeffrey Walton
2019-11-29 20:04     ` Jeffrey Walton
2019-11-30  4:37       ` Jeffrey Walton
2019-11-30  6:16         ` Alexander Mihalicyn
2019-11-30  6:40         ` Valdis Klētnieks
2019-11-30  8:13           ` Bjørn Mork
2019-11-30  9:11             ` Valdis Klētnieks
2019-11-30 10:10               ` Bjørn Mork
2019-11-30 10:34                 ` Valdis Klētnieks
2019-11-30 12:54                   ` [PATCH] net/tls: Fix return values for setsockopt Valentin Vidic
2019-11-30 13:15                     ` Jeffrey Walton
2019-11-30 13:31                       ` Valentin Vidić

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).