Bug 202295

Summary: usr/src/sbin/ipfw/dummynet.c:1306: bad if test ?
Product: Base System Reporter: David Binderman <dcb314>
Component: miscAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Some People CC: ae
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description David Binderman 2015-08-13 16:10:04 UTC
[usr/src/sbin/ipfw/dummynet.c:1306]: (style) Same expression on both sides of '||'.

Source code is

        if (v[1] < v[0] ||
            v[1] >= DN_MAX_ID-1 ||
            v[1] >= DN_MAX_ID-1) {
            continue; /* invalid entry */

Maybe

        if (v[1] < v[0] ||
            v[0] >= DN_MAX_ID-1 ||
            v[1] >= DN_MAX_ID-1) {
            continue; /* invalid entry */
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-05-02 05:21:23 UTC
A commit references this bug:

Author: ae
Date: Tue May  2 05:20:55 UTC 2017
New revision: 317667
URL: https://svnweb.freebsd.org/changeset/base/317667

Log:
  In parse_range() validate both range values instead of checking
  the top  value twice.

  PR:		202295
  MFC after:	1 week

Changes:
  head/sbin/ipfw/dummynet.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-05-10 05:04:43 UTC
A commit references this bug:

Author: ae
Date: Wed May 10 05:04:17 UTC 2017
New revision: 318133
URL: https://svnweb.freebsd.org/changeset/base/318133

Log:
  MFC r317667:
    In parse_range() validate both range values instead of checking
    the top value twice.

    PR:		202295

Changes:
_U  stable/11/
  stable/11/sbin/ipfw/dummynet.c