From nobody@FreeBSD.org  Tue Feb  4 12:04:17 2014
Return-Path: <nobody@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 DE9239B8
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <sp@m.davydov.spb.su>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ifconfig(8) fails to autoload if_tap.ko when creating vmnet interface
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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-net
>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:  Wed Apr 16 02:08:07 UTC 2014
>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 separate
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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Apr 16 02:05:37 UTC 2014 
Responsible-Changed-Why:  
this is kind of a generic problem with interface naming. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186449 
>Unformatted:
