From owner-svn-src-head@FreeBSD.ORG Thu Dec 3 19:45:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 832D3106566C; Thu, 3 Dec 2009 19:45:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id ECE268FC0C; Thu, 3 Dec 2009 19:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 92C8341C7A5; Thu, 3 Dec 2009 20:45:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id C6r-82dK-Yxi; Thu, 3 Dec 2009 20:45:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id F41E541C796; Thu, 3 Dec 2009 20:45:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id A65334448EC; Thu, 3 Dec 2009 19:43:33 +0000 (UTC) Date: Thu, 3 Dec 2009 19:43:33 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Hajimu UMEMOTO In-Reply-To: <200912031116.nB3BGsm2091411@svn.freebsd.org> Message-ID: <20091203193619.J83957@maildrop.int.zabbadoz.net> References: <200912031116.nB3BGsm2091411@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200055 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 19:45:08 -0000 On Thu, 3 Dec 2009, Hajimu UMEMOTO wrote: > Author: ume > Date: Thu Dec 3 11:16:53 2009 > New Revision: 200055 > URL: http://svn.freebsd.org/changeset/base/200055 > > Log: > Teach an IPv6 to the debug prints. > > Modified: > head/sys/netinet/ipfw/ip_fw2.c > > Modified: head/sys/netinet/ipfw/ip_fw2.c > ============================================================================== > --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 09:18:40 2009 (r200054) > +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 11:16:53 2009 (r200055) > @@ -1050,6 +1050,28 @@ hash_packet(struct ipfw_flow_id *id) > return i; > } > > +static __inline void > +unlink_dyn_rule_print(struct ipfw_flow_id *id) > +{ > + struct in_addr da; > + char src[48], dst[48]; Does it need to be 48 rather than 46? You do not have the [] here. If not INET6_ADDRSTRLEN is what we use elsewhere. I would actually prefer to only have #ifdef INET6 char src[INET6_ADDRSTRLEN|48], .. #else char src[INET_ADDRSTRLEN|18], .. #endif as it's 60 bytes of stack size for people w/o INET6 support (shame on them;-) Some applies for equivalent code further down. Ideally we would also hide the INET things under INET but that's a longer way to go... /bz > +#ifdef INET6 > + if (IS_IP6_FLOW_ID(id)) { > + ip6_sprintf(src, &id->src_ip6); > + ip6_sprintf(dst, &id->dst_ip6); > + } else > +#endif > + { > + da.s_addr = htonl(id->src_ip); > + inet_ntoa_r(da, src); > + da.s_addr = htonl(id->dst_ip); > + inet_ntoa_r(da, dst); > + } > + printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", > + src, id->src_port, dst, id->dst_port, V_dyn_count - 1); > +} -- Bjoern A. Zeeb It will not break if you know what you are doing.