diff options
author | Peter Hessler <phessler@cvs.openbsd.org> | 2017-01-22 00:39:46 +0000 |
---|---|---|
committer | Peter Hessler <phessler@cvs.openbsd.org> | 2017-01-22 00:39:46 +0000 |
commit | 50aa824955f4311ecdc302cf17976bddbd2aa2b2 (patch) | |
tree | eac0af1e07a3c06425d800e05aded86e8ce2c720 | |
parent | 254640e548721e6d359601f09fb965fbd331dff8 (diff) |
set the TOS/ECN field to Internetwork Control, since that is exactly
what we are doing
-rw-r--r-- | sys/net/bfd.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/net/bfd.c b/sys/net/bfd.c index dacc735ddc0..250d5a690c1 100644 --- a/sys/net/bfd.c +++ b/sys/net/bfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bfd.c,v 1.54 2017/01/21 10:15:15 phessler Exp $ */ +/* $OpenBSD: bfd.c,v 1.55 2017/01/22 00:39:45 phessler Exp $ */ /* * Copyright (c) 2016 Peter Hessler <phessler@openbsd.org> @@ -443,6 +443,17 @@ bfd_listener(struct bfd_config *bfd, unsigned int port) goto close; } + MGET(mopt, M_WAIT, MT_SOOPTS); + mopt->m_len = sizeof(int); + ip = mtod(mopt, int *); + *ip = IPTOS_PREC_INTERNETCONTROL; + error = sosetopt(so, IPPROTO_IP, IP_TOS, mopt); + if (error) { + printf("%s: sosetopt error %d\n", + __func__, error); + goto close; + } + MGET(m, M_WAIT, MT_SONAME); m->m_len = src->sa_len; sa = mtod(m, struct sockaddr *); |