From owner-freebsd-audit Sun Mar 25 9:43:36 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailgate.originative.co.uk (mailgate.originative.co.uk [62.232.68.68]) by hub.freebsd.org (Postfix) with ESMTP id 9090337B718 for ; Sun, 25 Mar 2001 09:43:28 -0800 (PST) (envelope-from paul@freebsd-services.co.uk) Received: from freebsd-services.co.uk (lobster.originative.co.uk [62.232.68.81]) by mailgate.originative.co.uk (Postfix) with ESMTP id 9C1F41D149 for ; Sun, 25 Mar 2001 18:43:21 +0100 (BST) Message-ID: <3ABE2E39.C69E1160@freebsd-services.co.uk> Date: Sun, 25 Mar 2001 18:43:21 +0100 From: Paul Richards X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-audit@freebsd.org Subject: if_name panic Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If you unload an ethernet driver then you can get a panic from if_name. This patch fixes it but I think it's a cludgy fix since I don't think if_name should be called if the interface is gone and the checks should be elsewhere. There's 44 calls to if_name and their all in the KAME code as far as I can see so it might take a while to fix properly in co-ordination with them but this causes a panic so it should probably be considered a showstopper bug that should be bandaided like this before 4.3 goes out (with a more appropriate error message though :-)). Index: net_osdep.c =================================================================== RCS file: /home/ncvs/src/sys/net/net_osdep.c,v retrieving revision 1.3 diff -u -r1.3 net_osdep.c --- net_osdep.c 2000/07/04 16:35:04 1.3 +++ net_osdep.c 2001/03/25 17:35:32 @@ -54,6 +54,10 @@ { static char nam[IFNAMSIZ + 10]; /*enough?*/ - snprintf(nam, sizeof(nam), "%s%d", ifp->if_name, ifp->if_unit); + if (! ifp || ! ifp->if_name || ! ifp->if_unit) { + snprintf(nam, sizeof(nam), "XXX No name, if gone?"); + } else { + snprintf(nam, sizeof(nam), "%s%d", ifp->if_name, ifp->if_unit); + } return nam; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message