From nobody Sun Mar 3 14:50:11 2024 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tnl9c1tMDz5CwGd for ; Sun, 3 Mar 2024 14:50:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tnl9c0q8Nz4G4y for ; Sun, 3 Mar 2024 14:50:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709477412; a=rsa-sha256; cv=none; b=GVmobip1OrIn4F1WTC1s44dvoJx5cQpg8DhcCgldJ48JSQUmrIZFljj+juifSd7OFGc8bK 39AQKb3R0rHUmed/h8rTQ7/uugo+yJ9AINgM+IiKNenIFv3eyozc1Tws2ZvVDMBpX6aCPX AbMavBixvXGNtVc3+mK1YfotUlcb3oSOhrLTvV86bmhSzlRAfh551Wwjk6ZahtkYkxoGwC 6gKofpMwvBWF0uUvd8Q/gqZJmFq5knz8+X+Vu/e4Zk2tO8o2BzV1xHhSXMVB94l70qr2Hj 0oGAwpC66KsLtGGlXFLl6X/f+69ZhaeTGehRhMxgqZ6pwa9RC3gpyJK2jQQ7sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709477412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+oLQS8Xbo7io5L+5c0w7qxPI6FiuSiRBeAEbOdD3k88=; b=NSKB/Cvh6iDyisPtz6nXhYkCeWB7NJ4Cei3EWBf14e/OXWo0JWC+b5Kdubwgd2MdJzYh0O mUjj9yXVXV9go6w7udpX/9JE6yDvrwA8Llm5PO3c6GmUbEjrjaaPP3fHIV+op1xLWHI6vW kCsMi6bBpaeKJc10+vgZzwtPVWD3cgP9z3+/z5EHYEig39rngZzj7FynftYUpas/ES19cl PEzYQcOv8QD6C+Szrt7hVOhMNLvh74fwnMngyOb8D+pcQRr+D6l8g29KcXKOd9ujodtZL5 aOki+R5VHZWILSeQvpO/mKMoQKtyFDr1z3Xt+Jzt4PTnNreBYfG2aLT9rspyDA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tnl9c0FTNzj46 for ; Sun, 3 Mar 2024 14:50:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 423EoBgC047048 for ; Sun, 3 Mar 2024 14:50:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 423EoBwX047042 for net@FreeBSD.org; Sun, 3 Mar 2024 14:50:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 277435] [Feature request] Add an option to destroy the tap/tun interface when the descriptor is closed Date: Sun, 03 Mar 2024 14:50:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: monsterovich@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277435 --- Comment #4 from Nikolay Borodin --- (In reply to Kyle Evans from comment #3) > though you can destroy it, you just have to close it first You can't. If you try to do this via SIOCIFDESTROY inside an application wh= ich uses the descriptor, the application will hang, even if you do ioctl after close(fd) The sample code from my application: JFUNC(void, close) { close(getFd(env, this)); struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, "tap0"); int sock =3D socket(PF_INET, SOCK_STREAM, 0); ioctl(sock, SIOCIFDESTROY, &ifr); // hangs } After that, you can only terminate the application via kill -9 . --=20 You are receiving this mail because: You are the assignee for the bug.=