git: socket: Implement getsockopt(SO_ACCEPTCONN)

Aaron LI aly at crater.dragonflybsd.org
Tue Oct 6 18:42:42 PDT 2026


commit e8451580465d38d2f12e2740ba125f7606a2b275
Author: David Bidner <david at crap.solutions>
Date:   Tue Oct 6 06:42:37 2026 +0200

    socket: Implement getsockopt(SO_ACCEPTCONN)
    
    SO_ACCEPTCONN is defined in <sys/socket.h>, but sogetopt() did not
    handle it, so getsockopt(2) returned ENOPROTOOPT.  FreeBSD, OpenBSD
    and NetBSD all report it among the SOL_SOCKET options.
    
    TigerVNC and similar servers probe this option to tell whether
    their standard input is a connected socket or a listening socket
    inherited from inetd "wait" mode.  Without it, TigerVNC treats the
    listening socket as connected, getpeername() fails with ENOTCONN,
    and inetd respawns the server in a loop.
    
    Add SO_ACCEPTCONN to the integer SOL_SOCKET option group, matching
    FreeBSD (see commit dcb5fef5dbd4ca8488deff7a9074850d851bdc08).
    
    Reported-by: Adrian Kieß
    Bug: https://bugs.dragonflybsd.org/issues/3300

Summary of changes:
 sys/kern/uipc_socket.c | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e8451580465d38d2f12e2740ba125f7606a2b275


-- 
DragonFly BSD source repository


More information about the Commits mailing list