socket-util: Fix set_dscp for IPv6
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 24 Feb 2014 02:46:59 +0000 (11:46 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 26 Feb 2014 16:18:03 +0000 (08:18 -0800)
commit92ae5930c220d5994b691346526bde548ea97765
treea3a3d8a48269f3ed3555cda2b3eae8d680c4853e
parent9a9808d7955b4cf50b6aac34101a68d76b173d63
socket-util: Fix set_dscp for IPv6

Try IPPROTO_IPV6/IPV6_TCLASS socket option as well as IPPROTO_IP/IP_TOS
so that this can work for IPv6 sockets.

IPPROTO_IP/IP_TOS socket option is, as it's SOL indicates, for IPv4.
What happens when it's used for IPv6 sockets?  On Linux, it seems to
be forwarded to IPv4 code and affects IPv4 part of the socket.
(e.g. non-V6ONLY case)  But it doesn't seem to be the intention of
this function.  On other platforms including NetBSD, it just fails
with ENOPROTOOPT.

Probably this function should take the address family but passing
it around lib/*stream*.c would be a bigger change.

Cc: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/socket-util.c
python/ovs/socket_util.py