Index: /pjproject/trunk/pjlib/include/pj/sock_qos.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/sock_qos.h	(revision 2966)
+++ /pjproject/trunk/pjlib/include/pj/sock_qos.h	(revision 2967)
@@ -32,5 +32,5 @@
 
 /**
- * @defgroup socket_qos Socket Quality of Service (QoS) API
+ * @defgroup socket_qos Socket Quality of Service (QoS) API: TOS, DSCP, WMM, IEEE 802.1p
  * @ingroup PJ_SOCK
  * @{
@@ -64,5 +64,5 @@
     At the Internet layer, you can use Differentiated Services/Diffserv and
     set the value of the Differentiated Services Code Point (DSCP) in the 
-    IP header. As defined in RFC 2472, the DSCP value is the high-order 6 bits
+    IP header. As defined in RFC 2474, the DSCP value is the high-order 6 bits
     of the IP version 4 (IPv4) TOS field and the IP version 6 (IPv6) Traffic 
     Class field.
@@ -180,5 +180,5 @@
      {
 	PJ_QOS_PARAM_HAS_DSCP = 1,
-	PJ_QOS_PARAM_HAS_802_1_P = 2,
+	PJ_QOS_PARAM_HAS_SO_PRIO = 2,
 	PJ_QOS_PARAM_HAS_WMM = 4
      } pj_qos_flag;
@@ -196,5 +196,5 @@
 	pj_uint8_t      flags;    // Determines which values to 
 				  // set, bitmask of pj_qos_flag
-	pj_uint8_t      dscp_val; // DSCP value to set
+	pj_uint8_t      dscp_val; // The 6 bits DSCP value to set
 	pj_uint8_t      so_prio;  // SO_PRIORITY value
 	pj_qos_wmm_prio wmm_prio; // WMM priority value
@@ -249,5 +249,5 @@
 {
     PJ_QOS_PARAM_HAS_DSCP = 1,	    /**< DSCP field is set.	    */
-    PJ_QOS_PARAM_HAS_802_1_P = 2,   /**< IEEE 802.1p  field is set  */
+    PJ_QOS_PARAM_HAS_SO_PRIO = 2,   /**< Socket SO_PRIORITY	    */
     PJ_QOS_PARAM_HAS_WMM = 4	    /**< WMM  field is set. 	    */
 } pj_qos_flag;
@@ -273,5 +273,5 @@
     pj_uint8_t      flags;    /**< Determines which values to 
 				   set, bitmask of pj_qos_flag	    */
-    pj_uint8_t      dscp_val; /**< DSCP value to set		    */
+    pj_uint8_t      dscp_val; /**< The 6 bits DSCP value to set	    */
     pj_uint8_t      so_prio;  /**< SO_PRIORITY value		    */
     pj_qos_wmm_prio wmm_prio; /**< WMM priority value		    */
Index: /pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c	(revision 2966)
+++ /pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c	(revision 2967)
@@ -42,5 +42,6 @@
     /* Set TOS/DSCP */
     if (param->flags & PJ_QOS_PARAM_HAS_DSCP) {
-	int val = param->dscp_val;
+	/* Value is dscp_val << 2 */
+	int val = (param->dscp_val << 2);
 	status = pj_sock_setsockopt(sock, pj_SOL_IP(), pj_IP_TOS(), 
 				    &val, sizeof(val));
@@ -52,10 +53,10 @@
 
     /* Set SO_PRIORITY */
-    if (param->flags & PJ_QOS_PARAM_HAS_802_1_P) {
+    if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) {
 	int val = param->so_prio;
 	status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(),
 				    &val, sizeof(val));
 	if (status != PJ_SUCCESS) {
-	    param->flags &= ~(PJ_QOS_PARAM_HAS_802_1_P);
+	    param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO);
 	    last_err = status;
 	}
@@ -94,5 +95,5 @@
     if (status == PJ_SUCCESS) {
 	p_param->flags |= PJ_QOS_PARAM_HAS_DSCP;
-	p_param->dscp_val = (pj_uint8_t)val;
+	p_param->dscp_val = (pj_uint8_t)(val >> 2);
     } else {
 	last_err = status;
@@ -104,5 +105,5 @@
 				&val, &optlen);
     if (status == PJ_SUCCESS) {
-	p_param->flags |= PJ_QOS_PARAM_HAS_802_1_P;
+	p_param->flags |= PJ_QOS_PARAM_HAS_SO_PRIO;
 	p_param->so_prio = (pj_uint8_t)val;
     } else {
@@ -129,2 +130,3 @@
 
 #endif	/* PJ_QOS_IMPLEMENTATION */
+
Index: /pjproject/trunk/pjlib/src/pj/sock_qos_common.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/sock_qos_common.c	(revision 2966)
+++ /pjproject/trunk/pjlib/src/pj/sock_qos_common.c	(revision 2967)
@@ -24,5 +24,5 @@
 
 #define THIS_FILE   "sock_qos_common.c"
-#define ALL_FLAGS   (PJ_QOS_PARAM_HAS_DSCP | PJ_QOS_PARAM_HAS_802_1_P | \
+#define ALL_FLAGS   (PJ_QOS_PARAM_HAS_DSCP | PJ_QOS_PARAM_HAS_SO_PRIO | \
                      PJ_QOS_PARAM_HAS_WMM)
 
@@ -67,5 +67,5 @@
     }
 
-    if (param->flags & PJ_QOS_PARAM_HAS_802_1_P) {
+    if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) {
 	for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) {
 	    if (param->so_prio >= qos_map[i].so_prio)
Index: /pjproject/trunk/pjlib/src/pj/sock_qos_symbian.cpp
===================================================================
--- /pjproject/trunk/pjlib/src/pj/sock_qos_symbian.cpp	(revision 2966)
+++ /pjproject/trunk/pjlib/src/pj/sock_qos_symbian.cpp	(revision 2967)
@@ -28,5 +28,5 @@
     
     /* SO_PRIORITY and WMM are not supported */
-    param->flags &= ~(PJ_QOS_PARAM_HAS_802_1_P | PJ_QOS_PARAM_HAS_WMM);
+    param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO | PJ_QOS_PARAM_HAS_WMM);
     
     if (param->flags & PJ_QOS_PARAM_HAS_DSCP) {
