From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 13 05:40:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8FB9106568B for ; Tue, 13 Oct 2009 05:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A449F8FC14 for ; Tue, 13 Oct 2009 05:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9D5e1S7015310 for ; Tue, 13 Oct 2009 05:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9D5e1uK015309; Tue, 13 Oct 2009 05:40:01 GMT (envelope-from gnats) Resent-Date: Tue, 13 Oct 2009 05:40:01 GMT Resent-Message-Id: <200910130540.n9D5e1uK015309@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Roman Bogorodskiy Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7E3106566B for ; Tue, 13 Oct 2009 05:36:41 +0000 (UTC) (envelope-from novel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3248FC19 for ; Tue, 13 Oct 2009 05:36:41 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9D5aeho015277 for ; Tue, 13 Oct 2009 05:36:40 GMT (envelope-from novel@freefall.freebsd.org) Received: (from novel@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9D5aeMJ015276; Tue, 13 Oct 2009 05:36:40 GMT (envelope-from novel) Message-Id: <200910130536.n9D5aeMJ015276@freefall.freebsd.org> Date: Tue, 13 Oct 2009 05:36:40 GMT From: Roman Bogorodskiy To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/139559: several tun(4) interfaces can be created with same dst addr X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Roman Bogorodskiy List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2009 05:40:02 -0000 >Number: 139559 >Category: kern >Synopsis: several tun(4) interfaces can be created with same dst addr >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 13 05:40:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Roman Bogorodskiy >Release: FreeBSD 9.0-CURRENT amd64 >Organization: >Environment: >Description: I'm using -CURRENT for some time and I use tun(4) in pair with ppp(8). I have several connections and sometimes it happens that remote pair sends dst address that is already used on other tun(4) interface. Previously, ppp complained about "File exists" error when assigning a new address and redialed. Few days (maybe weeks) ago I've noted a regression: ppp complains about "File exists", but nevertheless address gets assigned to the interface. I've experimented a bit with it and I have an impression that there's some bug in SIOCAIFADDR implementation and it's not related to ppp directly. See the 'How-To-Repeat' section. >How-To-Repeat: (09:09) novel@underworld:~ %> sudo ifconfig tun4 create (09:10) novel@underworld:~ %> sudo ifconfig tun5 create (09:10) novel@underworld:~ %> sudo ifconfig tun4 10.0.0.2 10.0.0.1 (09:10) novel@underworld:~ %> ifconfig tun4 tun4: flags=8051 metric 0 mtu 1500 inet 10.0.0.2 --> 10.0.0.1 netmask 0xff000000 (09:10) novel@underworld:~ %> ifconfig tun5 tun5: flags=8010 metric 0 mtu 1500 (09:10) novel@underworld:~ %> sudo ifconfig tun5 10.0.0.3 10.0.0.1 ifconfig: ioctl (SIOCAIFADDR): File exists (09:18) novel@underworld:~ %> ifconfig tun5 tun5: flags=8051 metric 0 mtu 1500 inet 10.0.0.3 --> 10.0.0.1 netmask 0xff000000 (09:18) novel@underworld:~ %> As you can see, ifconfig throwed the "File exists", but for some reason address got assigned, which seems to be wrong to me. Though, data for tun5 wasn't added to the routing table. >Fix: >Release-Note: >Audit-Trail: >Unformatted: