From owner-freebsd-current Mon Apr 1 00:27:25 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA08657 for current-outgoing; Mon, 1 Apr 1996 00:27:25 -0800 (PST) Received: from gw.pinewood.nl (gw.pinewood.nl [192.31.139.9]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id AAA08649 for ; Mon, 1 Apr 1996 00:27:22 -0800 (PST) Received: (from smap@localhost) by gw.pinewood.nl (8.6.12/8.6.12) id KAA18459 for ; Mon, 1 Apr 1996 10:27:14 +0200 Received: from pwood1.pinewood.nl(192.168.1.10) by gw.pinewood.nl via smap (V1.3) id sma018347; Mon Apr 1 10:26:20 1996 Received: (from franky@localhost) by pwood1.pinewood.nl (8.7.3/8.6.12) id JAA20724; Mon, 1 Apr 1996 09:26:19 +0100 (MET) From: "Frank ten Wolde" Message-Id: <9604010926.ZM20722@pwood1.pinewood.nl> Date: Mon, 1 Apr 1996 09:26:18 +0100 X-Face: 'BsFf8'k.q?J#?|$D*,)/?sRB{woUK&9\5K{ERmT;VTSyNLBb?muLf>b:Pt&VTDw8YCaC]6 C!MRSMr5UNjZLa]fi? X-Mailer: Z-Mail (3.2.1 10oct95) To: current@FreeBSD.ORG Subject: src/sbin/ipfw/ipfw.c broken (2.2-960323-SNAPSHOT, fix supplied) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Hello, I think I have found some small bugs in /usr/src/sbin/ipfw/ipfw.c (2.2-960323-SNAPSHOT): 1. Adding a port-range causes a SEGV: ipfw add accept all from any 1024-2048 to any Problem is at line 366 where (*av == NULL). 2. Listing a DST port-range when a SRC port range is in effect causes the DST port range to be listed with a ',' instead of a '-'. Problem is at line 178. 3. The usage is misleading: ... action: {allow|deny|reject|count}[,log] ... Should read: action: {allow|deny|reject|count} [log] (note the space and the removal of the ',') I'm not sure who maintains this code so I post it here expecting it to be picked up by the appropriate person(s). --- SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP --- *** /usr/src/sbin/ipfw/ipfw.c.orig Sat Feb 24 14:39:46 1996 --- /usr/src/sbin/ipfw/ipfw.c Mon Apr 1 10:24:22 1996 *************** *** 175,181 **** comma = " "; for (i=0;ifw_ndp;i++) { printf("%s%d",comma,chain->fw_pts[chain->fw_nsp+i]); ! if (i==chain->fw_nsp && (chain->fw_flg & IP_FW_F_DRNG)) comma = "-"; else comma = ","; --- 175,181 ---- comma = " "; for (i=0;ifw_ndp;i++) { printf("%s%d",comma,chain->fw_pts[chain->fw_nsp+i]); ! if (i==0 && (chain->fw_flg & IP_FW_F_DRNG)) comma = "-"; else comma = ","; *************** *** 281,287 **** "\t\tlist [number]\n" "\t\tzero [number]\n" "\trule:\taction proto src dst extras...\n" ! "\t\taction: {allow|deny|reject|count}[,log]\n" "\t\tproto: {ip|tcp|udp|icmp}}\n" "\t\tsrc: {any|ip[{/bits|:mask}]} [{port|port-port},...]\n" "\t\tdst: {any|ip[{/bits|:mask}]} [{port|port-port},...]\n" --- 281,287 ---- "\t\tlist [number]\n" "\t\tzero [number]\n" "\trule:\taction proto src dst extras...\n" ! "\t\taction: {allow|deny|reject|count} [log]\n" "\t\tproto: {ip|tcp|udp|icmp}}\n" "\t\tsrc: {any|ip[{/bits|:mask}]} [{port|port-port},...]\n" "\t\tdst: {any|ip[{/bits|:mask}]} [{port|port-port},...]\n" *************** *** 362,368 **** sc = 0; i = 1; } ! while (1) { s = strchr(*av,','); if (s) { sc = *s; --- 362,368 ---- sc = 0; i = 1; } ! while (*av != NULL) { s = strchr(*av,','); if (s) { sc = *s; --- SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP SNIP --- -Frank -- ---------------------------------------------------------------------- F.W. ten Wolde (PA3FMT) Pinewood Automation B.V. E-mail: franky@pinewood.nl Kluyverweg 2a Phone: +31-15 2682543 2629 HT Delft