From owner-svn-src-projects@FreeBSD.ORG Tue Mar 29 15:14:32 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 105981065673; Tue, 29 Mar 2011 15:14:32 +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 F3B4B8FC08; Tue, 29 Mar 2011 15:14:31 +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 p2TFEVuv032210; Tue, 29 Mar 2011 15:14:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2TFEVYA032208; Tue, 29 Mar 2011 15:14:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201103291514.p2TFEVYA032208@svn.freebsd.org> From: Attilio Rao Date: Tue, 29 Mar 2011 15:14:31 +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: r220129 - 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 15:14:32 -0000 Author: attilio Date: Tue Mar 29 15:14:31 2011 New Revision: 220129 URL: http://svn.freebsd.org/changeset/base/220129 Log: Fix style for frontline sending 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 15:08:50 2011 (r220128) +++ projects/sv/sys/netinet/netdump_client.c Tue Mar 29 15:14:31 2011 (r220129) @@ -208,7 +208,7 @@ sysctl_handle_ifxname(SYSCTL_HANDLER_ARG } /* - * Sysctl handler to deal with converting a string sysctl to/from an in_addr. + * Sysctl handler converting a string sysctl to/from an in_addr. * * Parameters: * SYSCTL_HANDLER_ARGS @@ -267,12 +267,10 @@ TUNABLE_INT("net.dump.enable", &nd_enabl */ /* - * [netdump_mbuf_nop] - * - * netdump wraps external mbufs around address ranges. unlike most sane + * Netdump wraps external mbufs around address ranges. unlike most sane * counterparts, netdump uses a stop-and-wait approach to flow control and * retransmission, so the ack obviates the need for mbuf reference - * counting. we still need to tell other mbuf handlers not to do anything + * counting. We still need to tell other mbuf handlers not to do anything * special with our mbufs, so specify this nop handler. * * Parameters: @@ -285,12 +283,9 @@ TUNABLE_INT("net.dump.enable", &nd_enabl static void netdump_mbuf_nop(void *ptr, void *opt_args) { - ; } /* - * [netdump_ether_output] - * * Handles creation of the ethernet header, then places outgoing packets into * the tx buffer for the NIC * @@ -307,15 +302,15 @@ netdump_mbuf_nop(void *ptr, void *opt_ar */ static int netdump_ether_output(struct mbuf *m, struct ifnet *ifp, struct ether_addr dst, - u_short etype) + u_short etype) { struct ether_header *eh; - /* fill in the ethernet header */ + /* Fill in the ethernet header. */ M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); - if (m == 0) { + if (m == NULL) { printf("netdump_ether_output: Out of mbufs\n"); - return ENOBUFS; + return (ENOBUFS); } eh = mtod(m, struct ether_header *); memcpy(eh->ether_shost, IF_LLADDR(ifp), ETHER_ADDR_LEN); @@ -326,23 +321,21 @@ netdump_ether_output(struct mbuf *m, str (ifp->if_drv_flags & IFF_DRV_RUNNING) != IFF_DRV_RUNNING) { if_printf(ifp, "netdump_ether_output: Interface isn't up\n"); m_freem(m); - return ENETDOWN; + return (ENETDOWN); } if (_IF_QFULL(&ifp->if_snd)) { if_printf(ifp, "netdump_ether_output: TX queue full\n"); m_freem(m); - return ENOBUFS; + return (ENOBUFS); } _IF_ENQUEUE(&ifp->if_snd, m); - return 0; + return (0); } /* - * [netdump_udp_output] - * - * unreliable transmission of an mbuf chain to the netdump server + * Unreliable transmission of an mbuf chain to the netdump server * Note: can't handle fragmentation; fails if the packet is larger than * nd_ifp->if_mtu after adding the UDP/IP headers * @@ -361,9 +354,9 @@ netdump_udp_output(struct mbuf *m) MPASS(nd_ifp != NULL); M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT); - if (m == 0) { + if (m == NULL) { printf("netdump_udp_output: Out of mbufs\n"); - return ENOBUFS; + return (ENOBUFS); } ui = mtod(m, struct udpiphdr *); bzero(ui->ui_x1, sizeof(ui->ui_x1)); @@ -391,14 +384,12 @@ netdump_udp_output(struct mbuf *m) ip->ip_sum = in_cksum(m, sizeof(struct ip)); if (m->m_pkthdr.len > nd_ifp->if_mtu) { - /* Whoops. The packet is too big. */ - printf("netdump_udp_output: Packet is too big: " - "%u > MTU %lu\n", m->m_pkthdr.len, nd_ifp->if_mtu); + printf("netdump_udp_output: Packet is too big: %u > MTU %lu\n", + m->m_pkthdr.len, nd_ifp->if_mtu); m_freem(m); - return ENOBUFS; + return (ENOBUFS); } - - return netdump_ether_output(m, nd_ifp, nd_gw_mac, ETHERTYPE_IP); + return (netdump_ether_output(m, nd_ifp, nd_gw_mac, ETHERTYPE_IP)); } /*