From owner-freebsd-bugs@freebsd.org Thu Feb 21 17:22:23 2019 Return-Path: Delivered-To: freebsd-bugs@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 11C9614E8DD1 for ; Thu, 21 Feb 2019 17:22:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9B09B843FD for ; Thu, 21 Feb 2019 17:22:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 5BAF114E8DD0; Thu, 21 Feb 2019 17:22:22 +0000 (UTC) Delivered-To: bugs@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 479A114E8DCE for ; Thu, 21 Feb 2019 17:22:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1831843F5 for ; Thu, 21 Feb 2019 17:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 22A861D614 for ; Thu, 21 Feb 2019 17:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x1LHMLJS026761 for ; Thu, 21 Feb 2019 17:22:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x1LHML48026759 for bugs@FreeBSD.org; Thu, 21 Feb 2019 17:22:21 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: bugs@FreeBSD.org Subject: [Bug 235920] ifconfig: unable to create another interface after renaming the previous one with the same name Date: Thu, 21 Feb 2019 17:22:21 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: olevole@olevole.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2019 17:22:23 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235920 --- Comment #1 from olevole@olevole.ru --- We can test that the interface is actually renamed via ioctl() via: #include #include #include #include #include #include ------- int list_devices() { char data[4096]; struct ifconf ifc; struct ifreq *ifr; int sk,length; unsigned int idx; sk =3D socket(AF_INET, SOCK_DGRAM, 0); if(sk < 0) { perror("socket"); return 0; } ifc.ifc_len =3D sizeof(data); ifc.ifc_buf =3D (caddr_t)data; if(ioctl(sk, SIOCGIFCONF, &ifc) < 0) { perror("ioctl(SIOCGIFCONF)"); return 0; } ifr =3D (struct ifreq*)data; for(int i=3D0;iifr_addr.sa_len; idx=3Dif_nametoindex(ifr->ifr_name); printf("Found: %s [index: %d]\n", ifr->ifr_name,idx); ifr=3D(struct ifr*)((char*)ifr+length); i+=3Dlength; } return 0; } ---------- ifr->ifr_name is changing, but the index is the same (and this is normal?). However, some information remains from the old interface, and this affects http://man.freebsd.org/alloc_unr_specific/9 --=20 You are receiving this mail because: You are the assignee for the bug.=