Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/blacklist/libexec make proto and port optional



details:   https://anonhg.NetBSD.org/src/rev/900b5f6f1d6a
branches:  trunk
changeset: 338640:900b5f6f1d6a
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jun 02 14:02:39 2015 +0000

description:
make proto and port optional

diffstat:

 external/bsd/blacklist/libexec/blacklistd-helper |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r 2c554fe3ac71 -r 900b5f6f1d6a external/bsd/blacklist/libexec/blacklistd-helper
--- a/external/bsd/blacklist/libexec/blacklistd-helper  Tue Jun 02 14:02:10 2015 +0000
+++ b/external/bsd/blacklist/libexec/blacklistd-helper  Tue Jun 02 14:02:39 2015 +0000
@@ -11,7 +11,13 @@
 
 case "$1" in
 add)
-       exec /sbin/npfctl rule $2 add block in final proto $3 from $4/$5 to any port $6
+       if [ -n "$3" ]; then
+               proto="proto $3"
+       fi
+       if [ -n "$6" ]; then
+               port="port $6"
+       fi
+       exec /sbin/npfctl rule $2 add block in final $proto from $4/$5 to any $port
        ;;
 rem)
        exec /sbin/npfctl rule $2 rem-id $7



Home | Main Index | Thread Index | Old Index