Commit a0240d73 authored by Dave Taht's avatar Dave Taht Committed by Juliusz Chroboczek

Set diffserv to CS6 for babel packets

Setting the IPv6 dscp field to CS6 allows for babel packets to
'jump' a bufferbloated queue and get to a destination sooner.

With the pfifo_fast qdisc (the default for ethernet), this
'does the right thing'.

With mac80211 wireless, this moves babel packets into the VO
queue, from which it is hopefully extracted and then multicast.
parent bfa1e271
......@@ -21,12 +21,14 @@ THE SOFTWARE.
*/
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
......@@ -42,6 +44,7 @@ babel_socket(int port)
int s, rc;
int saved_errno;
int one = 1, zero = 0;
const int ds = 0xc0; /* CS6 - Network Control */
s = socket(PF_INET6, SOCK_DGRAM, 0);
if(s < 0)
......@@ -70,6 +73,15 @@ babel_socket(int port)
if(rc < 0)
goto fail;
#ifdef IPV6_TCLASS
rc = setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &ds, sizeof(ds));
#else
rc = -1;
errno = ENOSYS;
#endif
if(rc < 0)
perror("Couldn't set traffic class");
rc = fcntl(s, F_GETFL, 0);
if(rc < 0)
goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment