socket-util: Use correct address family in set_dscp(), instead of guessing.
authorBen Pfaff <blp@nicira.com>
Fri, 20 Feb 2015 19:30:50 +0000 (11:30 -0800)
committerAlex Wang <alexw@nicira.com>
Fri, 20 Feb 2015 21:45:09 +0000 (13:45 -0800)
commitba8df9af52a897d8fd663b57eb345e7c5f94b925
tree398865d9a356c0b05f51d59159d029fac62717c5
parent611f766e77b3da91db98308794c0659a197d0ed1
socket-util: Use correct address family in set_dscp(), instead of guessing.

The set_dscp() function, until now, tried to set the DSCP as IPv4 and as
IPv6. This worked OK on Linux, where an ENOPROTOOPT error made it really
clear which one was wrong, but FreeBSD uses EINVAL instead, which has
multiple meanings and which it therefore seems somewhat risky to ignore.
Instead, this commit just tries to set the correct address family's DSCP
option.

Tested by Alex Wang on FreeBSD 9.3.

Reported-by: Atanu Ghosh <atanu@acm.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Tested-by: Alex Wang <alexw@nicira.com>
lib/socket-util.c
lib/socket-util.h
python/ovs/socket_util.py