diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2019-03-27 15:17:29 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2019-03-27 15:17:29 +0000 |
commit | 77c2fe20df6a9a7c1a353e1a4ab2ba80fefab881 (patch) | |
tree | ce88d390c1e320eab9800a3d0c59f8e892e271f2 /crypto | |
parent | 0967215db7b6354f5af4cabe9aa8bd8d0c4118ba (diff) |
Add workaround for a QoS-related bug in VMWare Workstation.
Submitted by: yuripv
Differential Revision: https://reviews.freebsd.org/D18636
Notes
Notes:
svn path=/head/; revision=345579
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/openssh/readconf.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c index f97a6ac72a95..9ed6902a0f46 100644 --- a/crypto/openssh/readconf.c +++ b/crypto/openssh/readconf.c @@ -16,6 +16,9 @@ __RCSID("$FreeBSD$"); #include <sys/types.h> +#ifdef VMWARE_GUEST_WORKAROUND +#include <sys/sysctl.h> +#endif #include <sys/stat.h> #include <sys/socket.h> #include <sys/wait.h> @@ -1954,6 +1957,15 @@ fill_default_options(Options * options) { char *all_cipher, *all_mac, *all_kex, *all_key; int r; +#ifdef VMWARE_GUEST_WORKAROUND + char scval[7]; /* "vmware\0" */ + size_t scsiz = sizeof(scval); + int vmwguest = 0; + + if (sysctlbyname("kern.vm_guest", scval, &scsiz, NULL, 0) == 0 && + strcmp(scval, "vmware") == 0) + vmwguest = 1; +#endif if (options->forward_agent == -1) options->forward_agent = 0; @@ -2088,8 +2100,18 @@ fill_default_options(Options * options) if (options->visual_host_key == -1) options->visual_host_key = 0; if (options->ip_qos_interactive == -1) +#ifdef VMWARE_GUEST_WORKAROUND + if (vmwguest) + options->ip_qos_interactive = IPTOS_LOWDELAY; + else +#endif options->ip_qos_interactive = IPTOS_DSCP_AF21; if (options->ip_qos_bulk == -1) +#ifdef VMWARE_GUEST_WORKAROUND + if (vmwguest) + options->ip_qos_bulk = IPTOS_THROUGHPUT; + else +#endif options->ip_qos_bulk = IPTOS_DSCP_CS1; if (options->request_tty == -1) options->request_tty = REQUEST_TTY_AUTO; |