From owner-p4-projects@FreeBSD.ORG Mon Dec 11 13:08:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BED6B16A415; Mon, 11 Dec 2006 13:08:59 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82C5916A403 for ; Mon, 11 Dec 2006 13:08:59 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id B477A43CA8 for ; Mon, 11 Dec 2006 13:07:42 +0000 (GMT) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBBD8xIM066048 for ; Mon, 11 Dec 2006 13:08:59 GMT (envelope-from zec@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBBD8w8b066045 for perforce@freebsd.org; Mon, 11 Dec 2006 13:08:58 GMT (envelope-from zec@FreeBSD.org) Date: Mon, 11 Dec 2006 13:08:58 GMT Message-Id: <200612111308.kBBD8w8b066045@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@FreeBSD.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 111455 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Dec 2006 13:09:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=111455 Change 111455 by zec@zec_tca51 on 2006/12/11 13:08:33 Add an assert catching vnet modules that have exported an attach interface but have not set their initialization ordering priority flag. The first catch of the day is netgraph. Additionally, fix a bug where vnet_netgraph_iattach was recursively calling itself. Affected files ... .. //depot/projects/vimage/src/sys/kern/kern_vimage.c#9 edit .. //depot/projects/vimage/src/sys/netgraph/ng_base.c#3 edit Differences ... ==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#9 (text+ko) ==== @@ -85,12 +85,15 @@ { /* * XXX we support only statically assigned module IDs at the time. - * In principle modules should be able to be dynamically assigned - * an ID at registration time. + * In principle modules should be able to get a dynamically + * assigned ID at registration time. */ - VNET_ASSERT(modinfo->id > 0 || modinfo->id < VNET_MOD_MAX) - VNET_ASSERT(vnet_modules[modinfo->id].modinfo == NULL) + VNET_ASSERT(modinfo->id > 0 || modinfo->id < VNET_MOD_MAX); + VNET_ASSERT(vnet_modules[modinfo->id].modinfo == NULL); + VNET_ASSERT(modinfo->i_attach == NULL || (modinfo->i_attach && + ((modinfo->flags & VNET_MFLAG_ORDER_1ST) || + (modinfo->flags & VNET_MFLAG_ORDER_2ND)))); vnet_modules[modinfo->id].modinfo = modinfo; TAILQ_INSERT_TAIL(&vnet_modlink_head, ==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#3 (text+ko) ==== @@ -243,6 +243,7 @@ static struct vnet_modinfo vnet_netgraph_modinfo = { .id = VNET_MOD_NETGRAPH, + .flags = VNET_MFLAG_ORDER_2ND, .name = "netgraph", .symmap = NULL, .i_attach = vnet_netgraph_iattach, @@ -3131,7 +3132,6 @@ struct vnet_netgraph *vnet_netgraph; if (curvnetb == &vnetb_0) { - vnet_mod_register(&vnet_netgraph_modinfo); vnet_netgraph = &vnet_netgraph_0; } else { vnet_netgraph = malloc(sizeof(struct vnet_netgraph),