From nobody Tue Dec 12 04:02:37 2023 X-Original-To: dev-commits-src-all@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 4Sq4hF6mPNz53K18; Tue, 12 Dec 2023 04:02:37 +0000 (UTC) (envelope-from git@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 4Sq4hF64JQz4CwZ; Tue, 12 Dec 2023 04:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702353757; 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; bh=ekLSbFB7qIpw6KKAjWNw5ohK6FmCLqe/f67NHrWrh7o=; b=dP25VJKwpIoqr4vV37YYgJfzutInzlda+pPLQIDhlfKhPae/kRktnfV83H+xZkxDdjOlOn EQlq4/Fbvz+vcEULFph4ldzxethN+o8h2Puisg/ROcDiDMFbKbt9vlERtsukg+8441Qq/X Grdg5VAFNj25B7VZxi6XlJuTC+kXOLyawVcP5JYP3QoBAHH+0t89p7xoOOmiqyiyC7JwPT K6t+1KRkbkG8Im8cnC38w99FRzm/pCl+UqrhdLA6kuGwHQZln1xb+XIg0Rqe9uCLgm57VP H1AuDm0xkeLHLGmt4eX6VyEBOCgUjgRE0KwOVUY7OsO5HYBEwtzJPvzjQl3m2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702353757; a=rsa-sha256; cv=none; b=P5fFj2218hxREC4FMQ04L9anvN12Iq26TVbd7ckRcP+y1kySu44PBncDSt2GeF3RESFGBn X7g5WlNSt/jCp8L82eU3ihL0OlYI2lceevW7gaIdZqnAb1PKTSL4KRxz4RqFtUDwScVX/H GQoWm+wWjqP2QBvhmdneUr5ybetbnFeVYlRGZWsikzCQ+cEYf2m5ClXgT6en77hzdfoKjm Yj2CDK/bcjErMYJwfpQYEPXtW36CE4njEyhktJFvrOFsSfWEK/fwuE7nO26Uy0k38ADfnb DWWMh2VVMpSfIQOUSvFnyUyjGb4Czx9mC4Ekx3MrXI9HnS61N/jFH1Iysdyikg== 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=1702353757; 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; bh=ekLSbFB7qIpw6KKAjWNw5ohK6FmCLqe/f67NHrWrh7o=; b=OVC6ulUVkRyZkWuRycDBOlvLXtU3LjdOTE+qDuRBhwAMShS2nzOIzyqDBlIWiWsRU3Mm65 9w8KcL9TksKjinloeyV63stgR/9AgueIuNLKWhbVjilDje+EvXd5Y2zFmUoms32HdXn0o/ W1VZFz2KQveZW5QtgpEWVl7rEFHj5H/HI49XZnCCO+Hprt2dPNSSi6KDs6jD6KsOTae6sD 2gT7LGZXWgdgzJKjSZbdL4ElqhZT+pfOvsBUz5HUG86VMpbjSTry0QW9Qqq4Z5l+y2Wr1R 9OAfOze9OdHC2DFNVLHTI02rhlTtGF8G/f+D4gFABcrrF/Pgs8MJ4AVjtzmL8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Sq4hF58bWz10Jc; Tue, 12 Dec 2023 04:02:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BC42bSf062405; Tue, 12 Dec 2023 04:02:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BC42bE0062403; Tue, 12 Dec 2023 04:02:37 GMT (envelope-from git) Date: Tue, 12 Dec 2023 04:02:37 GMT Message-Id: <202312120402.3BC42bE0062403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0365e5fc905b - main - if_tun: check device name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0365e5fc905b425313a0a2d89f0d8e2566924df2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0365e5fc905b425313a0a2d89f0d8e2566924df2 commit 0365e5fc905b425313a0a2d89f0d8e2566924df2 Author: Konstantin Belousov AuthorDate: 2023-12-12 00:13:59 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-12 04:02:11 +0000 if_tun: check device name to avoid panic if the name already exists, which is possible with the interface renaming. PR: 266999 Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43001 --- sys/net/if_tuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index fccc666e2a00..4cb219dc92b6 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -820,7 +820,7 @@ tun_create_device(struct tuntap_driver *drv, int unit, struct ucred *cr, make_dev_args_init(&args); if (cr != NULL) - args.mda_flags = MAKEDEV_REF; + args.mda_flags = MAKEDEV_REF | MAKEDEV_CHECKNAME; args.mda_devsw = &drv->cdevsw; args.mda_cr = cr; args.mda_uid = UID_UUCP;