From owner-freebsd-net@FreeBSD.ORG Tue Nov 20 14:17:45 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A50DE16A418 for ; Tue, 20 Nov 2007 14:17:45 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [IPv6:2001:200:1b1::35]) by mx1.freebsd.org (Postfix) with ESMTP id 46A0213C481 for ; Tue, 20 Nov 2007 14:17:45 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from mymb.local (g046141.ppp.asahi-net.or.jp [211.132.46.141]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id 08A3973020 for ; Tue, 20 Nov 2007 23:17:44 +0900 (JST) Date: Tue, 20 Nov 2007 23:17:43 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: freebsd-net@freebsd.org User-Agent: Wanderlust/2.14.0 (Africa) Emacs/22.0 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Tue_Nov_20_23:17:43_2007-1" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: a format error in pf_print_host() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2007 14:17:45 -0000 --Multipart_Tue_Nov_20_23:17:43_2007-1 Content-Type: text/plain; charset=US-ASCII (This should probably be reported to an OpenBSD forum, but I'm not subscribing to any of the lists, so I'm posting this to freebsd-net. I believe pf maintainers watch this list, too...) I've found a minor error in pf_print_host() which is revealed for some time of IPv6 addresses. This routine always (perhaps unintentionally) assumes abbreviate-able consecutive zero's, so, for example, it formats "1:2:3:4:5:6:7:8" as ":2:3:4:5:6:7:8". This can be confirmed by the sample code attached to this message by - saving the file as e.g. "foo.c" - cc -o foo foo.c - ./foo 1:2:3:4:5:6:7:8 I've also attached a proposed patch to this problem. The diff was made against 6-STABLE, but it's probably applicable to other versions. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp --Multipart_Tue_Nov_20_23:17:43_2007-1--