]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Add SIOCRDSGETTOS to get the current TOS for the socket
authorBang Nguyen <bang.nguyen@oracle.com>
Mon, 25 Feb 2013 17:18:17 +0000 (09:18 -0800)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 20:37:56 +0000 (13:37 -0700)
Orabug: 16397197
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
(cherry picked from commit 201e2362694aab25b4ef6b11e5bd62b75b2a0e17)

include/uapi/linux/rds.h
net/rds/af_rds.c

index ec0a19475a3b9cc57fe8acaeddd7c1e3b1abe746..1caffb379c3eb653a6951e36f3e3e478d5d55845 100644 (file)
@@ -63,6 +63,7 @@
  * ioctl commands for SOL_RDS
 */
 #define SIOCRDSSETTOS                   (SIOCPROTOPRIVATE)
+#define SIOCRDSGETTOS                  (SIOCPROTOPRIVATE + 1)
 
 typedef u_int8_t         rds_tos_t;
 
index 48406609889c212f7111ec53fa0dcdc35232b71a..5869a0434fe1d61127baecc88e3f052d0cac36ea 100644 (file)
@@ -227,6 +227,13 @@ static int rds_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                rs->rs_tos = tos;
                spin_unlock_bh(&rds_sock_lock);
                break;
+        case SIOCRDSGETTOS:
+                spin_lock_bh(&rds_sock_lock);
+                tos = rs->rs_tos;
+                spin_unlock_bh(&rds_sock_lock);
+                if (put_user(tos, (rds_tos_t __user *)arg))
+                        return -EFAULT;
+                break;
        default:
                return -ENOIOCTLCMD;
        }