Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Mar 2012 00:48:54 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r232805 - in stable/9/sys: kern sys
Message-ID:  <201203110048.q2B0ms5c086105@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Mar 11 00:48:54 2012
New Revision: 232805
URL: http://svn.freebsd.org/changeset/base/232805

Log:
  MFC r232179:
  Add SO_PROTOCOL/SO_PROTOTYPE socket SOL_SOCKET-level option to get the
  socket protocol number.
  
  PR:	kern/162352

Modified:
  stable/9/sys/kern/uipc_socket.c
  stable/9/sys/sys/socket.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/uipc_socket.c
==============================================================================
--- stable/9/sys/kern/uipc_socket.c	Sun Mar 11 00:43:01 2012	(r232804)
+++ stable/9/sys/kern/uipc_socket.c	Sun Mar 11 00:48:54 2012	(r232805)
@@ -2728,6 +2728,10 @@ integer:
 			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;

Modified: stable/9/sys/sys/socket.h
==============================================================================
--- stable/9/sys/sys/socket.h	Sun Mar 11 00:43:01 2012	(r232804)
+++ stable/9/sys/sys/socket.h	Sun Mar 11 00:48:54 2012	(r232805)
@@ -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
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203110048.q2B0ms5c086105>