[PATCH] Set TOS (TCLASS) bits under ipv6

Stephen Hemminger shemminger at vyatta.com
Wed Sep 28 13:02:27 EDT 2011


On Wed, 28 Sep 2011 06:03:01 -0700
Dave Taht <dave.taht at gmail.com> wrote:

> > I agree flags for SCP would make sense, I'll take a look
> > where to do that.  
> 
> I think openssh does half the job (the scp side sets bulk),
> I haven't looked at it yet (mostly working on cerowrt
> right now)

If you look at latest openssh source (5.6p1) then you will see
that it has codt to DSCP bits the same for both IPv4 and IPv6.

	packet_set_tos(interactive ? qos_interactive : qos_bulk);

static void
packet_set_tos(int tos)
{
#ifndef IP_TOS_IS_BROKEN
	if (!packet_connection_is_on_socket())
		return;
	switch (packet_connection_af()) {
# ifdef IP_TOS
	case AF_INET:
		debug3("%s: set IP_TOS 0x%02x", __func__, tos);
		if (setsockopt(active_state->connection_in,
		    IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0)
			error("setsockopt IP_TOS %d: %.100s:",
			    tos, strerror(errno));
		break;
# endif /* IP_TOS */
# ifdef IPV6_TCLASS
	case AF_INET6:
		debug3("%s: set IPV6_TCLASS 0x%02x", __func__, tos);
		if (setsockopt(active_state->connection_in,
		    IPPROTO_IPV6, IPV6_TCLASS, &tos, sizeof(tos)) < 0)
			error("setsockopt IPV6_TCLASS %d: %.100s:",
			    tos, strerror(errno));
		break;
# endif /* IPV6_TCLASS */
	}
#endif /* IP_TOS_IS_BROKEN */
}

This version of openssh is in Debian testing (wheezy) and probably
other bleeding edge distros.




More information about the Bloat-devel mailing list