Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg/simple/Pipe: support IPv6 QoS. #13370

Merged
merged 1 commit into from
Feb 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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