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 turned mapped v4 addresses to...



details:   https://anonhg.NetBSD.org/src/rev/57b258cb7bb6
branches:  trunk
changeset: 343092:57b258cb7bb6
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jan 22 22:31:11 2016 +0000

description:
turned mapped v4 addresses to real v4 addresses so that they work.

diffstat:

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

diffs (21 lines):

diff -r 93a5ee6ed947 -r 57b258cb7bb6 external/bsd/blacklist/libexec/blacklistd-helper
--- a/external/bsd/blacklist/libexec/blacklistd-helper  Fri Jan 22 22:27:01 2016 +0000
+++ b/external/bsd/blacklist/libexec/blacklistd-helper  Fri Jan 22 22:31:11 2016 +0000
@@ -17,7 +17,16 @@
        if [ -n "$6" ]; then
                port="port $6"
        fi
-       exec /sbin/npfctl rule $2 add block in final $proto from $4/$5 to any $port
+       addr=$4
+       mask=$5
+       case "$4" in
+       ::ffff:*.*.*.*)
+               if [ "$5" = 128 ]; then
+                       mask=32
+                       addr=${4#::ffff:}
+               fi;;
+       esac
+       exec /sbin/npfctl rule $2 add block in final $proto from $addr/$mask to any $port
        ;;
 rem)
        exec /sbin/npfctl rule $2 rem-id $7



Home | Main Index | Thread Index | Old Index