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.
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