mirror of
https://github.com/openvswitch/ovs
synced 2025-09-04 00:05:15 +00:00
Use int type for setsockopt IP_TOS value
FreeBSD requires that setsockopt(..., IP_TOS, ...) be passed an int value. Linux accepts either int or char types (and has since at least kernel 2.6.12) so just use int type unconditionally. Signed-off-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -94,12 +94,14 @@ xset_nonblocking(int fd)
|
|||||||
static int
|
static int
|
||||||
set_dscp(int fd, uint8_t dscp)
|
set_dscp(int fd, uint8_t dscp)
|
||||||
{
|
{
|
||||||
|
int val;
|
||||||
|
|
||||||
if (dscp > 63) {
|
if (dscp > 63) {
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
dscp = dscp << 2;
|
val = dscp << 2;
|
||||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof dscp)) {
|
if (setsockopt(fd, IPPROTO_IP, IP_TOS, &val, sizeof val)) {
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user