summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/bfd.c13
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 *);