Hi, attached there is the (simple) implementation of the read-only SO_ACCEPTCONN socket option in pflocal. (pfinet could need it too, just need to dig into its Linux code more.)
May I push it? Thanks, -- Pino Toscano
>From 18d76905be35500afdb8ef47c1086f6376540da4 Mon Sep 17 00:00:00 2001 From: Pino Toscano <toscano.p...@tiscali.it> Date: Sat, 7 Sep 2013 18:30:03 +0200 Subject: [PATCH] pflocal: return the SO_ACCEPTCONN socket option * pflocal/socket.c (S_socket_getopt) <SO_ACCEPTCONN>: New case. --- pflocal/socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pflocal/socket.c b/pflocal/socket.c index ce1edd8..7b6f283 100644 --- a/pflocal/socket.c +++ b/pflocal/socket.c @@ -438,6 +438,11 @@ S_socket_getopt (struct sock_user *user, *(int *)*value = user->sock->pipe_class->sock_type; *value_len = sizeof (int); break; + case SO_ACCEPTCONN: + assert (*value_len >= sizeof (int)); + *(int *)*value = user->sock->addr != NULL ? 1 : 0; + *value_len = sizeof (int); + break; default: ret = ENOPROTOOPT; break; -- 1.8.4.rc3
signature.asc
Description: This is a digitally signed message part.