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)
committerBen Pfaff <blp@nicira.com>
Fri, 20 Feb 2015 19:36:12 +0000 (11:36 -0800)
commitafc1d536743e2d869fe90712b51a57334b57e3cc
tree2395288fbb174b2bd61c1e1e68b468e025541d64
parentc2e3cbaf7bde655d7521a63dd57a13085125c3b4
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