]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Pipe: conditionally compile IPTOS setting
authorJosh Durgin <jdurgin@redhat.com>
Mon, 9 Feb 2015 22:55:15 +0000 (14:55 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Mon, 9 Feb 2015 22:55:15 +0000 (14:55 -0800)
This doesn't exist on older platforms.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/msg/simple/Pipe.cc

index b28fc33f809f0a3416651c89917d0ee0345abdd4..74f2c8762184bf20dc960ede107574bda402792c 100644 (file)
@@ -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.