Bug 193888

Summary: ipfw list will show previous enable rule when current one is disabled.
Product: Base System Reporter: bycn82
Component: kernAssignee: Andrey V. Elsukov <ae>
Status: Closed FIXED    
Severity: Affects Only Me CC: ae, melifaro
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
set the header of the buffer to 0 none

Description bycn82 2014-09-24 12:13:49 UTC
Created attachment 147635 [details]
set the header of the buffer to 0

bp_flush() doesnt clean the buffer, it resets the pointers only.
the "ipfw list" will do below

loop rules and do
   1.if current rule is disabled
        continue
     otherwise
         write rule into the buffer,
   2.printf(buffer)
   3.bp_flush(buffer).
done

so it will print the previous enable rule when current one is disabled.
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-03-09 14:47:27 UTC
A commit references this bug:

Author: ae
Date: Wed Mar  9 14:47:05 UTC 2016
New revision: 296566
URL: https://svnweb.freebsd.org/changeset/base/296566

Log:
  Set buffer to empty string to prevent duplicated output in some cases.

  PR:		193888

Changes:
  head/sbin/ipfw/ipfw2.c