Support ToS/DiffServ for IPv6 meta and UDP connections.

Also remember ToS/DiffServ priority for each socket individually. This
is a port of commits c72e237 and 042a6c1.
This commit is contained in:
Guus Sliepen 2016-04-10 17:22:41 +02:00
parent e355088535
commit c544e5e8fe
4 changed files with 35 additions and 15 deletions

View file

@ -1,7 +1,7 @@
/*
net_socket.c -- Handle various kinds of sockets.
Copyright (C) 1998-2005 Ivo Timmermans,
2000-2014 Guus Sliepen <guus@tinc-vpn.org>
2000-2016 Guus Sliepen <guus@tinc-vpn.org>
2006 Scott Lamb <slamb@slamb.org>
2009 Florian Forster <octo@verplant.org>
@ -82,6 +82,11 @@ static void configure_tcp(connection_t *c) {
option = IPTOS_LOWDELAY;
setsockopt(c->socket, SOL_IP, IP_TOS, (void *)&option, sizeof option);
#endif
#if defined(IPPROTO_IPV6) && defined(IPV6_TCLASS) && defined(IPTOS_LOWDELAY)
option = IPTOS_LOWDELAY;
setsockopt(c->socket, IPPROTO_IPV6, IPV6_TCLASS, (void *)&option, sizeof option);
#endif
}
static bool bind_to_interface(int sd) {