From 93629d3d4cf2484bdf49a1ef879ffaa6e2bd3b3a Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Mon, 9 Feb 2015 14:55:15 -0800 Subject: [PATCH] Pipe: conditionally compile IPTOS setting This doesn't exist on older platforms. Signed-off-by: Josh Durgin --- src/msg/simple/Pipe.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index b28fc33f809..74f2c876218 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. -- 2.47.3