From owner-svn-src-all@freebsd.org Mon Jun 6 22:26:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EED9B63E66; Mon, 6 Jun 2016 22:26:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C101B35; Mon, 6 Jun 2016 22:26:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u56MQJoo047908; Mon, 6 Jun 2016 22:26:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u56MQJeN047906; Mon, 6 Jun 2016 22:26:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606062226.u56MQJeN047906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 6 Jun 2016 22:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301527 - in head: share/man/man4 sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:26:20 -0000 Author: bz Date: Mon Jun 6 22:26:18 2016 New Revision: 301527 URL: https://svnweb.freebsd.org/changeset/base/301527 Log: Add a `show igi_list` command to DDB to debug IGMP state. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ddb.4 head/sys/netinet/igmp.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Mon Jun 6 22:09:22 2016 (r301526) +++ head/share/man/man4/ddb.4 Mon Jun 6 22:26:18 2016 (r301527) @@ -688,6 +688,13 @@ The second one is the name of the interr Those functions are machine dependent. .\" .Pp +.It Ic show Cm igi_list Ar addr +Show information about the IGMP structure +.Vt struct igmp_ifsoftc +present at +.Ar addr . +.\" +.Pp .It Ic show Cm inodedeps Op Ar addr Show brief information about each inodedep structure. If Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Mon Jun 6 22:09:22 2016 (r301526) +++ head/sys/netinet/igmp.c Mon Jun 6 22:26:18 2016 (r301527) @@ -50,6 +50,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include @@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DDB +#include +#endif + #include #include #include @@ -3641,6 +3647,37 @@ vnet_igmp_uninit(const void *unused __un VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_igmp_uninit, NULL); +#ifdef DDB +DB_SHOW_COMMAND(igi_list, db_show_igi_list) +{ + struct igmp_ifsoftc *igi, *tigi; + LIST_HEAD(_igi_list, igmp_ifsoftc) *igi_head; + + if (!have_addr) { + db_printf("usage: show igi_list \n"); + return; + } + igi_head = (struct _igi_list *)addr; + + LIST_FOREACH_SAFE(igi, igi_head, igi_link, tigi) { + db_printf("igmp_ifsoftc %p:\n", igi); + db_printf(" ifp %p\n", igi->igi_ifp); + db_printf(" version %u\n", igi->igi_version); + db_printf(" v1_timer %u\n", igi->igi_v1_timer); + db_printf(" v2_timer %u\n", igi->igi_v2_timer); + db_printf(" v3_timer %u\n", igi->igi_v3_timer); + db_printf(" flags %#x\n", igi->igi_flags); + db_printf(" rv %u\n", igi->igi_rv); + db_printf(" qi %u\n", igi->igi_qi); + db_printf(" qri %u\n", igi->igi_qri); + db_printf(" uri %u\n", igi->igi_uri); + /* SLIST_HEAD(,in_multi) igi_relinmhead */ + /* struct mbufq igi_gq; */ + db_printf("\n"); + } +} +#endif + static int igmp_modevent(module_t mod, int type, void *unused __unused) {