git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use int type for setsockopt IP_TOS value
[sliver-openvswitch.git]
/
lib
/
socket-util.c
diff --git
a/lib/socket-util.c
b/lib/socket-util.c
index
2c5e6cc
..
314761d
100644
(file)
--- a/
lib/socket-util.c
+++ b/
lib/socket-util.c
@@
-94,12
+94,14
@@
xset_nonblocking(int fd)
static int
set_dscp(int fd, uint8_t dscp)
{
static int
set_dscp(int fd, uint8_t dscp)
{
+ int val;
+
if (dscp > 63) {
return EINVAL;
}
if (dscp > 63) {
return EINVAL;
}
-
dscp
= dscp << 2;
- if (setsockopt(fd, IPPROTO_IP, IP_TOS, &
dscp, sizeof dscp
)) {
+
val
= dscp << 2;
+ if (setsockopt(fd, IPPROTO_IP, IP_TOS, &
val, sizeof val
)) {
return errno;
}
return errno;
}