From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 4 12:10:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85A7CBE8 for ; Tue, 4 Feb 2014 12:10:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E5F7150B for ; Tue, 4 Feb 2014 12:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s14CA09q004535 for ; Tue, 4 Feb 2014 12:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s14CA0kO004534; Tue, 4 Feb 2014 12:10:00 GMT (envelope-from gnats) Resent-Date: Tue, 4 Feb 2014 12:10:00 GMT Resent-Message-Id: <201402041210.s14CA0kO004534@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Valentin Davydov Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE9239B8 for ; Tue, 4 Feb 2014 12:04:17 +0000 (UTC) Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C757714C5 for ; Tue, 4 Feb 2014 12:04:17 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s14C4GAK032508 for ; Tue, 4 Feb 2014 12:04:16 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s14C4Gld032496; Tue, 4 Feb 2014 12:04:16 GMT (envelope-from nobody) Message-Id: <201402041204.s14C4Gld032496@oldred.freebsd.org> Date: Tue, 4 Feb 2014 12:04:16 GMT From: Valentin Davydov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/186449: ifconfig(8) fails to autoload if_tap.ko when creating vmnet interface X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Feb 2014 12:10:00 -0000 >Number: 186449 >Category: kern >Synopsis: ifconfig(8) fails to autoload if_tap.ko when creating vmnet interface >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 04 12:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Valentin Davydov >Release: 10.0-STABLE >Organization: State Optical Institute >Environment: FreeBSD pv.local 10.0-STABLE FreeBSD 10.0-STABLE #6 r261230: Tue Jan 28 22:12:46 MSK 2014 val@pv.local:/usr/obj/usr/src/sys/GENERIC amd64 >Description: ifconfig(8) utility has an ability to automatically load necessary kernel module when creating first instance of a new (say, dynamic) interface. Sometimes it works (e.g. ifconfig crate tap0) and sometimes doesn't (ifconfig create vmnet0). >How-To-Repeat: Boot with a clean GENERIC kernel. Become root. Say "ifconfig vmnet0 create". You should get "ifconfig: SIOCIFCREATE2: Invalid argument" diagnostics. At the same time "ifconfig tap0 create" works as expected (as well as "ifconfig vmnetN create" afterwards, when if_tap.ko is already loaded). >Fix: This problem is most probably caused by the ifmaybeload() function. It implicitly derives kernel module name from the interface name by removing numerical suffix and prepending "if_" prefix. Whereas both tap and vmnet interfaces share the same if_tap.ko kernel module, and there is no seperate if_vmnet.ko one. Possible workaround (successfully tested): during installkernel make a copy (or hardlink) of if_tap.ko under the name if_vmnet.ko, that works fine. By the way, it makes sense to hardlink tap(4) and vmnet(4) manual pages too. Comment: I woudn't dare recommend suggested workaround as an ultimate solution because of possible unforeseen pitfalls (such as filesystems incapable of hardlinks etc.). >Release-Note: >Audit-Trail: >Unformatted: