Skip to content

Commit

Permalink
msg/simple/Pipe: support IPv6 QoS.
Browse files Browse the repository at this point in the history
Extend DSCP marking for heartbeat packets to IPv6, as commit
9b9a682 only implemented
support for IPv4.

Backport: jewel, luminious
Fixes: http://tracker.ceph.com/issues/18887
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
  • Loading branch information
Robin H. Johnson committed Feb 11, 2017
1 parent 496012e commit 2d6021f
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/msg/simple/Pipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,24 @@ void Pipe::set_socket_options()
int r = -1;
#ifdef IPTOS_CLASS_CS6
int iptos = IPTOS_CLASS_CS6;
r = ::setsockopt(sd, IPPROTO_IP, IP_TOS, &iptos, sizeof(iptos));
if (r < 0) {

if (peer_addr.get_family() == AF_INET) {
r = ::setsockopt(sd, IPPROTO_IP, IP_TOS, &iptos, sizeof(iptos));
r = -errno;
ldout(msgr->cct,0) << "couldn't set IP_TOS to " << iptos
<< ": " << cpp_strerror(r) << dendl;
if (r < 0) {
ldout(msgr->cct,0) << "couldn't set IP_TOS to " << iptos
<< ": " << cpp_strerror(r) << dendl;
}
} else if (peer_addr.get_family() == AF_INET6) {
r = ::setsockopt(sd, IPPROTO_IPV6, IPV6_TCLASS, &iptos, sizeof(iptos));
r = -errno;
if (r < 0) {
ldout(msgr->cct,0) << "couldn't set IPV6_TCLASS to " << iptos
<< ": " << cpp_strerror(r) << dendl;
}
} else {
ldout(msgr->cct,0) << "couldn't set ToS of unknown family to " << iptos
<< dendl;
}
#endif
#if defined(SO_PRIORITY)
Expand Down

0 comments on commit 2d6021f

Please sign in to comment.