From cperon@staff.seccuris.com  Mon Aug 25 18:32:15 2003
Return-Path: <cperon@staff.seccuris.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0632116A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Aug 2003 18:32:15 -0700 (PDT)
Received: from staff.seccuris.com (staff.seccuris.com [204.112.0.40])
	by mx1.FreeBSD.org (Postfix) with SMTP id 2DE7243FE0
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 Aug 2003 18:32:14 -0700 (PDT)
	(envelope-from cperon@staff.seccuris.com)
Received: (qmail 59302 invoked by uid 1006); 26 Aug 2003 01:32:13 -0000
Message-Id: <20030826013213.59301.qmail@staff.seccuris.com>
Date: 26 Aug 2003 01:32:13 -0000
From: Chris S.J.Peron <maneo@bsdpro.com>
Reply-To: Chris S.J.Peron <maneo@bsdpro.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] redundant argument count check in ipfw
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55981
>Category:       bin
>Synopsis:       [patch] redundant argument count check in ipfw
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    luigi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 25 18:40:17 PDT 2003
>Closed-Date:    Sat May 08 18:56:29 PDT 2004
>Last-Modified:  Sat May 08 18:56:29 PDT 2004
>Originator:     Chris S.J. Peron
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
>Environment:
System: FreeBSD movl 5.1-CURRENT FreeBSD 5.1-CURRENT #14: Mon Aug 25 17:22:40 CDT 2003     modulus@movl:/usr/src/sys/i386/compile/RAID0 i386

	
>Description:

When ipfw2 processes the MAC{mac} option it performs a redundant argument count check,
then calls add_mac().

The first operation in add_mac() is the exact same argument count check.

	if (ac < 2)
		errx(EX_DATAERR, "MAC dst src");

	
>How-To-Repeat:
N/A
	
>Fix:


--- /usr/src/sbin/ipfw/ipfw2.c.timeless	Mon Aug 25 20:19:46 2003
+++ /usr/src/sbin/ipfw/ipfw2.c	Mon Aug 25 20:19:50 2003
@@ -3379,8 +3379,6 @@
 			break;
 
 		case TOK_MAC:
-			if (ac < 2)
-				errx(EX_USAGE, "MAC dst-mac src-mac");
 			if (add_mac(cmd, ac, av)) {
 				ac -= 2; av += 2;
 			}
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->luigi 
Responsible-Changed-By: luigi 
Responsible-Changed-When: Sat Sep 6 08:07:30 PDT 2003 
Responsible-Changed-Why:  
will fix this 


http://www.freebsd.org/cgi/query-pr.cgi?pr=55981 
State-Changed-From-To: open->closed  
State-Changed-By: csjp 
State-Changed-When: Sat May 8 18:54:21 PDT 2004 
State-Changed-Why:  
Committed fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55981 
>Unformatted:
