From owner-freebsd-net@FreeBSD.ORG Sat Jun 9 15:44:17 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 000871065672 for ; Sat, 9 Jun 2012 15:44:16 +0000 (UTC) (envelope-from gperez@entel.upc.edu) Received: from violet.upc.es (violet.upc.es [147.83.2.51]) by mx1.freebsd.org (Postfix) with ESMTP id 74EEA8FC0C for ; Sat, 9 Jun 2012 15:44:16 +0000 (UTC) Received: from entelserver.upc.edu (entelserver.upc.es [147.83.39.4]) by violet.upc.es (8.14.1/8.13.1) with ESMTP id q59ES1Db010957 for ; Sat, 9 Jun 2012 16:28:01 +0200 Received: from webmail.entel.upc.edu (webmail.entel.upc.es [147.83.39.6]) by entelserver.upc.edu (Postfix) with ESMTP id 801B02CBD18 for ; Sat, 9 Jun 2012 16:27:56 +0200 (CEST) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_7f2ea6bb87e1eea129bb2584420b95f0" Date: Sat, 09 Jun 2012 16:27:56 +0200 From: Gustau Perez Querol To: Message-ID: X-Sender: gperez@entel.upc.edu User-Agent: RoundCube Webmail/0.5.1 X-Mail-Scanned: Criba 2.0 + Clamd X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (violet.upc.es [147.83.2.51]); Sat, 09 Jun 2012 16:28:01 +0200 (CEST) Cc: Subject: Panic with if_bridge when removing components X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 15:44:17 -0000 --=_7f2ea6bb87e1eea129bb2584420b95f0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8; format=flowed Hi, I'm seeing panics when removing an interface of a bridge. The system runs HEAD/AMD64 r236733. I see no changes to if_bridge.c in the last two days, so I would say the problem's still there. I also checked stable and the problem should be there too. The problem is that I have a bridge composed of two ethernet interfaces, an ath interface and a tap. As soon as I remove any of them the system panics. Because the system runs openvpn with the tap connected to the bridge, when the system starts to reboot, the openvpn daemon removes the tap and thus causing also the panic. The panic comes because at sys/net/if_bridge.c:943 the struct *ifnet->if_bridge of the interface removed is set to NULL too early. Because of this, at sys/net/if_bridge.c:996 we call if_bridge.c:bridge_linkstate where the struct *ifnet->if_bridge is needed. This causes the panic. I can pastebin the core file if needed. I'm attaching a simple patch that solves it. The struct *ifnet->if_bridge could be set to null only if the interface removed is gone, but I think it won't hurt to set it to null in any case. Regards, Gustau --=_7f2ea6bb87e1eea129bb2584420b95f0 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=if_bridge.diff Content-Disposition: attachment; filename=if_bridge.diff ZGlmZiAtLWdpdCBhL3N5cy9uZXQvaWZfYnJpZGdlLmMgYi9zeXMvbmV0L2lmX2JyaWRnZS5jCmlu ZGV4IDI3MWVmMzAuLjZjMTEyZGUgMTAwNjQ0Ci0tLSBhL3N5cy9uZXQvaWZfYnJpZGdlLmMKKysr IGIvc3lzL25ldC9pZl9icmlkZ2UuYwpAQCAtOTQwLDcgKzk0MCw2IEBAIGJyaWRnZV9kZWxldGVf bWVtYmVyKHN0cnVjdCBicmlkZ2Vfc29mdGMgKnNjLCBzdHJ1Y3QgYnJpZGdlX2lmbGlzdCAqYmlm LAogCWlmIChiaWYtPmJpZl9mbGFncyAmIElGQklGX1NUUCkKIAkJYnN0cF9kaXNhYmxlKCZiaWYt PmJpZl9zdHApOwogCi0JaWZzLT5pZl9icmlkZ2UgPSBOVUxMOwogCUJSSURHRV9YTE9DSyhzYyk7 CiAJTElTVF9SRU1PVkUoYmlmLCBiaWZfbmV4dCk7CiAJQlJJREdFX1hEUk9QKHNjKTsKQEAgLTk5 NCw2ICs5OTMsNyBAQCBicmlkZ2VfZGVsZXRlX21lbWJlcihzdHJ1Y3QgYnJpZGdlX3NvZnRjICpz Yywgc3RydWN0IGJyaWRnZV9pZmxpc3QgKmJpZiwKIAl9CiAJYnN0cF9kZXN0cm95KCZiaWYtPmJp Zl9zdHApOwkvKiBwcmVwYXJlIHRvIGZyZWUgKi8KIAlicmlkZ2VfbGlua3N0YXRlKGlmcyk7CisJ aWZzLT5pZl9icmlkZ2UgPSBOVUxMOwogCUJSSURHRV9MT0NLKHNjKTsKIAlmcmVlKGJpZiwgTV9E RVZCVUYpOwogfQo= --=_7f2ea6bb87e1eea129bb2584420b95f0--