From owner-svn-src-projects@FreeBSD.ORG Tue Mar 29 16:49:51 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EB87106564A; Tue, 29 Mar 2011 16:49:51 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E78268FC0C; Tue, 29 Mar 2011 16:49:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2TGnoBA034601; Tue, 29 Mar 2011 16:49:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2TGnobN034599; Tue, 29 Mar 2011 16:49:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201103291649.p2TGnobN034599@svn.freebsd.org> From: Attilio Rao Date: Tue, 29 Mar 2011 16:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220136 - projects/sv/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2011 16:49:51 -0000 Author: attilio Date: Tue Mar 29 16:49:50 2011 New Revision: 220136 URL: http://svn.freebsd.org/changeset/base/220136 Log: Fix style for KLD specific functions. Modified: projects/sv/sys/netinet/netdump_client.c Modified: projects/sv/sys/netinet/netdump_client.c ============================================================================== --- projects/sv/sys/netinet/netdump_client.c Tue Mar 29 16:45:47 2011 (r220135) +++ projects/sv/sys/netinet/netdump_client.c Tue Mar 29 16:49:50 2011 (r220136) @@ -1176,11 +1176,9 @@ trig_abort: */ /* - * [netdump_config_defaults] - * * Called upon module load. Initializes the sysctl variables to sane defaults * (locates the first available NIC and uses the first IPv4 IP on that card as - * the client IP). Leaves the server IP unconfigured. + * the client IP). Leaves the server IP unconfigured. * * Parameters: * void @@ -1224,31 +1222,30 @@ netdump_config_defaults() static int netdump_modevent(module_t mod, int type, void *unused) { +#ifdef NETDUMP_CLIENT_DEBUG + char buf[INET_ADDRSTRLEN]; +#endif + switch (type) { case MOD_LOAD: netdump_config_defaults(); - - /* PRI_FIRST happens before the networks are disabled */ nd_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync, - netdump_trigger, NULL, - SHUTDOWN_PRI_FIRST); + netdump_trigger, NULL, SHUTDOWN_PRI_FIRST); #ifdef NETDUMP_CLIENT_DEBUG - if (!nd_ifp) - printf("netdump: Warning: No default interface " - "found. Manual configuration required.\n"); - else { - char buf[INET_ADDRSTRLEN]; + if (nd_ifp == NULL) { + printf("netdump: Warning: No default interface found. + printf("Manual configuration required.\n"); + } else { inet_ntoa_r(nd_client, buf); - printf("netdump: Using interface %s; client IP " - "%s\n", nd_ifp->if_xname, buf); + printf("netdump: Using interface %s; client IP %s\n", + nd_ifp->if_xname, buf); } #endif - printf("netdump initialized\n"); break; case MOD_UNLOAD: - if (nd_tag) { + if (nd_tag != NULL) { EVENTHANDLER_DEREGISTER(shutdown_pre_sync, nd_tag); nd_tag = NULL; } @@ -1257,7 +1254,7 @@ netdump_modevent(module_t mod, int type, default: break; } - return 0; + return (0); } static moduledata_t netdump_mod = {"netdump", netdump_modevent, 0}; DECLARE_MODULE(netdump, netdump_mod, SI_SUB_PROTO_END, SI_ORDER_ANY); @@ -1269,4 +1266,3 @@ DB_COMMAND(netdump, ddb_force_netdump) netdump_trigger(NULL, RB_DUMP); } #endif -