[lkml]   [2002]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectCould not set Traffic Class of IPv6 header in RH 7.3 using TCP socket

Am trying to set TC value of IPv6 header for TCP transmission at the application level using sockets mechanism.
The code goes like this:

struct sockaddr_in6 servAddr6;
UINT1 tclass = 10 /* Equivalent for DSCP value af11 */

servAddr6.sin6_flowinfo = htons ((tclass << 4) | IPV6_FLOWINFO_PRIORITY);
connect (sd, &servAddr6, ...);

In RH 7.1, the above code works fine for all the DSCP values set. In RH7.3, the behaviour is different.

I list below the behaviour phenomenon.
When tclass is assigned the values: 1, 2 or 3, the actual value set will be 0
When tclass is assigned the values: 5, 6 or 7, the actual value set will be 4
When tclass is assigned the values: 9, 10 or 11, the actual value set will be 8 and so on.

Otherwise, for tclass values 0, 4, 8 etc, the values are set correctly for the Prioirty field of the IPv6 header.

What could be the reason for the above behaviour? Could anybody give me the hint if i am doing anything wrong? The above behaviour happens in RH7.3. The same code works fine in RH 7.1

Also, i tried investigating the difference between RH7.1 and RH 7.3. I observed the following:

In RH7.1, in tcp_v6_connect() function of linux-2.4/net/ipv6/tcp_ipv6.c, a macro IP6_ECN_flow_init (label) is called which is defined as follows:

#define IP6_ECN_flow_init (label) do { \
(label) &= ~htonl (3<<20); \
} while (0)

#define IP6_ECN_flow_init (label) do { } while (0)

In my machine CONFIG_INET_ECN is not defined. So, in RH7.1, the macro IP6_ECN_flow_init does nothing.
But in RH 7.3, the above definition of the macro is always defined irrespective of whether CONFIG_INET_ECN is defined or not.
I observed that this defintion of the macro changes the Traffic Value i set before calling connect () socket call.

Could anybody guide me why is it like this? Is my understanding correct regarding this? Is there any way that i can set the traffic class correctly?

Thanks in advance.
Kindly CC the reply to my mail ID.


Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape!

Get your own FREE, personal Netscape Mail account today at

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.041 / U:3.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site