From owner-freebsd-hackers@freebsd.org Sat Apr 7 08:17:31 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90646F962F4 for ; Sat, 7 Apr 2018 08:17:31 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 1267E76096; Sat, 7 Apr 2018 08:17:30 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id D8076273D5; Sat, 7 Apr 2018 08:17:29 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w378HTMB037080 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 7 Apr 2018 08:17:29 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w378HTbw037079; Sat, 7 Apr 2018 08:17:29 GMT (envelope-from phk) To: Roman Bogorodskiy cc: freebsd-hackers@freebsd.org Subject: Re: Getting /dev entry by interface name In-reply-to: <20180407025807.GA18883@kloomba> From: "Poul-Henning Kamp" References: <20180407025807.GA18883@kloomba> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <37077.1523089049.1@critter.freebsd.dk> Date: Sat, 07 Apr 2018 08:17:29 +0000 Message-ID: <37078.1523089049@critter.freebsd.dk> X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2018 08:17:31 -0000 -------- In message <20180407025807.GA18883@kloomba>, Roman Bogorodskiy writes: >1. Create tap(4) like that: > ># ifconfig tap create >tap2 ># > >2. Rename it > ># ifconfig tap2 name testif >testif > >Now I can do 'ifconfig testif' and there'll be no signs that it was >named 'tap2' previously, however, in /dev it's still /dev/tap2. I would argue that is an error. The /dev entry should also be renamed, or maybe better, a symlink with the new name should be created, pointing to the /dev/tap%d entry. However, I dont know if that is actually possible, is the device driver even even told about the new interface name ? There is also a name-space validation issue to think about: ifconfig tap2 name ../etc -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.