svn commit: r345579 - in head: crypto/openssh secure/usr.bin/ssh

Dag-Erling Smørgrav des at FreeBSD.org
Tue Sep 3 14:05:46 UTC 2019


Author: des
Date: Wed Mar 27 15:17:29 2019
New Revision: 345579
URL: https://svnweb.freebsd.org/changeset/base/345579

Log:
  Add workaround for a QoS-related bug in VMWare Workstation.
  
  Submitted by:	yuripv
  Differential Revision:	https://reviews.freebsd.org/D18636

Modified:
  head/crypto/openssh/readconf.c
  head/secure/usr.bin/ssh/Makefile

Modified: head/crypto/openssh/readconf.c
==============================================================================
--- head/crypto/openssh/readconf.c	Wed Mar 27 14:51:03 2019	(r345578)
+++ head/crypto/openssh/readconf.c	Wed Mar 27 15:17:29 2019	(r345579)
@@ -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,7 +1957,16 @@ 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;
 	if (options->forward_x11 == -1)
@@ -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;

Modified: head/secure/usr.bin/ssh/Makefile
==============================================================================
--- head/secure/usr.bin/ssh/Makefile	Wed Mar 27 14:51:03 2019	(r345578)
+++ head/secure/usr.bin/ssh/Makefile	Wed Mar 27 15:17:29 2019	(r345579)
@@ -37,6 +37,9 @@ LIBADD+=	crypto
 CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
 .endif
 
+# Workaround VMware Workstation NAT bug
+CFLAGS+=-DVMWARE_GUEST_WORKAROUND
+
 .include <bsd.prog.mk>
 
 .PATH:	${SSHDIR}




More information about the svn-src-all mailing list