Author: kib
Date: Sun Mar 11 09:27:09 2012
New Revision: 232819
URL: http://svn.freebsd.org/changeset/base/232819

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

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

Modified: stable/8/sys/kern/uipc_socket.c
==============================================================================
--- stable/8/sys/kern/uipc_socket.c     Sun Mar 11 09:22:05 2012        
(r232818)
+++ stable/8/sys/kern/uipc_socket.c     Sun Mar 11 09:27:09 2012        
(r232819)
@@ -2713,6 +2713,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/8/sys/sys/socket.h
==============================================================================
--- stable/8/sys/sys/socket.h   Sun Mar 11 09:22:05 2012        (r232818)
+++ stable/8/sys/sys/socket.h   Sun Mar 11 09:27:09 2012        (r232819)
@@ -139,6 +139,8 @@ typedef     __uid_t         uid_t;
 #define        SO_LISTENQLEN   0x1012          /* socket's complete queue 
length */
 #define        SO_LISTENINCQLEN        0x1013  /* socket's incomplete queue 
length */
 #define        SO_SETFIB       0x1014          /* use this FIB to route */
+#define        SO_PROTOCOL     0x1016          /* get socket protocol (Linux 
name) */
+#define        SO_PROTOTYPE    SO_PROTOCOL     /* alias for SO_PROTOCOL (SunOS 
name) */
 #endif
 
 /*
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to