summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2017-01-24 02:52:37 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2017-01-24 02:52:37 +0000
commit7ae08118d26870e7137f109a8cf60edef2f30a38 (patch)
treedd7ed8661baffffba51ca78fe27d889209ff2aa6
parentc029c8dfe40543150d7602c769895d9e5f331be6 (diff)
move setting the IP TOS from the listening socket to the sending socket
-rw-r--r--sys/net/bfd.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/net/bfd.c b/sys/net/bfd.c
index 250d5a690c1..e3b9161b030 100644
--- a/sys/net/bfd.c
+++ b/sys/net/bfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bfd.c,v 1.55 2017/01/22 00:39:45 phessler Exp $ */
+/* $OpenBSD: bfd.c,v 1.56 2017/01/24 02:52:36 phessler Exp $ */
/*
* Copyright (c) 2016 Peter Hessler <phessler@openbsd.org>
@@ -443,17 +443,6 @@ 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 *);
@@ -537,6 +526,17 @@ bfd_sender(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 *);