NetBSD Problem Report #51476

From www@NetBSD.org  Wed Sep 14 11:22:53 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 304157A111
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 14 Sep 2016 11:22:53 +0000 (UTC)
Message-Id: <20160914112252.1780C7A2AE@mollari.NetBSD.org>
Date: Wed, 14 Sep 2016 11:22:52 +0000 (UTC)
From: francis.rounds@4bridgeworks.com
Reply-To: francis.rounds@4bridgeworks.com
To: gnats-bugs@NetBSD.org
Subject: vmt can't send long hostnames to VMware host
X-Send-Pr-Version: www-1.0

>Number:         51476
>Category:       port-i386
>Synopsis:       vmt can't send long hostnames to VMware host
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 14 11:25:00 +0000 2016
>Originator:     Francis Rounds
>Release:        -current 7.99.37 201609140250Z
>Organization:
Bridgeworks Ltd
>Environment:
NetBSD aaaaaaa.aaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa.aaaaaaaab.domain.local 7.99.37 NetBSD 7.99.37 (GENERIC.201609140250Z) amd64
>Description:
When a long hostname is set (240 characters or longer), the vmt driver is unable to send the hostname to the VMware/ESXi host.

dmesg shows the following errors:

vmt0: rpci command didn't fit in buffer
vmt0: unable to set hostname
>How-To-Repeat:
Set a hostname of 240 characters or longer, either using /etc/rc.conf and rebooting or using the hostname(1) command and waiting until the vmt0 errors appear on the console. In either case, dmesg should show the error.

That is, either set the following in /etc/rc.conf:

hostname=aaaaaaa.aaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa.aaaaaaaab.domain.local

or run:

hostname aaaaaaa.aaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa.aaaaaaaab.domain.local
>Fix:
In src/sys/arch/x86/x86/vmt.c, VMT_RPC_BUFLEN (the maximum size of the buffer used to communicate over the RPCI channel) is set to 256, which is also the value of MAXHOSTNAMELEN, the maximum length of a fully-qualified domain name.

Since the command to be sent is "SetGuestInfo  1 hostname" (where "hostname" is obviously the hostname to send to the host) and the "SetGuestInfo  1" prefix is 16 bytes long, adding at least 16 bytes to VMT_RPC_BUFLEN fixes the issue.

This was apparently also an issue in the original vmt from OpenBSD, but the buffer length was recently increased and so it's no longer an issue there: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pv/vmt.c?rev=1.8&content-type=text/x-cvsweb-markup

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.