Skip to content

Commit

Permalink
firewall/live-log, when changing the optimisation mode the line numbe…
Browse files Browse the repository at this point in the history
…rs don't seem to add up any more. Previously we used to parse the pf config to show our rules, it looks safer to use the actual running config using -vvPsr

ref https://forum.opnsense.org/index.php?topic=13308.0
  • Loading branch information
AdSchellevis committed Jun 29, 2019
1 parent 6b6e3ed commit 1d1ce84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/opnsense/scripts/filter/read_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def fetch_rule_details():

# use pfctl to create a list per rule number with the details found
with tempfile.NamedTemporaryFile() as output_stream:
subprocess.call(['/sbin/pfctl', '-vvPnf', '/tmp/rules.debug'],
subprocess.call(['/sbin/pfctl', '-vvPsr'],
stdout=output_stream, stderr=open(os.devnull, 'wb'))
output_stream.seek(0)
for line in output_stream.read().decode().strip().split('\n'):
Expand Down

2 comments on commit 1d1ce84

@guille79es
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch failed to apply on 2 devices, but I'm trying to apply the command directly and see if that works.

@fichtner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guille79es you need to use the backport f855ae7

Please sign in to comment.