diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 4cd6a93e5581..4233dda3a939 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2733,6 +2733,10 @@ sogetopt(struct socket *so, struct sockopt *sopt) optval = so->so_type; goto integer; + case SO_PROTOCOL: + optval = so->so_proto->pr_protocol; + goto integer; + case SO_ERROR: SOCK_LOCK(so); optval = so->so_error; diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 0d51a5bf56ef..d7c6c792d52f 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -138,6 +138,8 @@ typedef __uid_t uid_t; #define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ #define SO_SETFIB 0x1014 /* use this FIB to route */ #define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ +#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ +#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ #endif /*