bin/55981: [patch] redundant argument count check in ipfw

Chris S.J.Peron maneo at bsdpro.com
Mon Aug 25 18:40:19 PDT 2003


>Number:         55981
>Category:       bin
>Synopsis:       [patch] redundant argument count check in ipfw
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 25 18:40:17 PDT 2003
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:


More information about the freebsd-bugs mailing list