Page MenuHomeFreeBSD

improve ipfw rule creation for blacklist-helper script
ClosedPublic

Authored by lidl on Feb 20 2017, 1:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 5:32 PM
Unknown Object (File)
Sat, Mar 23, 12:25 AM
Unknown Object (File)
Feb 26 2024, 12:07 PM
Unknown Object (File)
Feb 26 2024, 12:03 PM
Unknown Object (File)
Feb 22 2024, 5:09 AM
Unknown Object (File)
Feb 10 2024, 10:42 AM
Unknown Object (File)
Feb 3 2024, 10:02 PM
Unknown Object (File)
Jan 14 2024, 5:57 PM
Subscribers

Details

Summary

The current blacklist-helper script adds a rule using 'ipfw add -q ...'
when a ipaddress/port needs to be blocked. The 'ipfw' command,
when using '-q', it not only suppresses output messages, changes the
behaviour so that it allows duplicate rules!

So, probe for an existing rule first, and if that probe fails, only then add
the rule.

Test Plan

Tested in a virtual machine, seems to work for me, but I am not an ipfw expert.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 7573

Event Timeline

lidl retitled this revision from to improve ipfw rule creation for blacklist-helper script.
lidl updated this object.
lidl edited the test plan for this revision. (Show Details)
lidl added a reviewer: emaste.
lidl set the repository for this revision to rS FreeBSD src repository - subversion.
allanjude added inline comments.
contrib/blacklist/libexec/blacklistd-helper
68

did you intend to drop the -q here?

contrib/blacklist/libexec/blacklistd-helper
68

I thought about this a lot, and decided that I don't need it, since I'm redirecting away stdout.

This revision is now accepted and ready to land.Feb 22 2017, 4:56 PM
This revision was automatically updated to reflect the committed changes.