From: Josh Durgin Date: Mon, 9 Feb 2015 22:55:15 +0000 (-0800) Subject: Pipe: conditionally compile IPTOS setting X-Git-Tag: v0.93~69^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93629d3d4cf2484bdf49a1ef879ffaa6e2bd3b3a;p=ceph.git Pipe: conditionally compile IPTOS setting This doesn't exist on older platforms. Signed-off-by: Josh Durgin --- diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index b28fc33f809f..74f2c8762184 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -850,13 +850,15 @@ void Pipe::set_socket_options() int prio = msgr->get_socket_priority(); if (prio >= 0) { + int r; +#ifdef IPTOS_CLASS_CS6 int iptos = IPTOS_CLASS_CS6; - int r = ::setsockopt(sd, IPPROTO_IP, IP_TOS, &iptos, sizeof(iptos)); + r = ::setsockopt(sd, IPPROTO_IP, IP_TOS, &iptos, sizeof(iptos)); if (r < 0) { ldout(msgr->cct,0) << "couldn't set IP_TOS to " << iptos << ": " << cpp_strerror(errno) << dendl; } - +#endif // setsockopt(IPTOS_CLASS_CS6) sets the priority of the socket as 0. // See http://goo.gl/QWhvsD and http://goo.gl/laTbjT // We need to call setsockopt(SO_PRIORITY) after it.