]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
location-functions.pl: Recognise XD / LOC_NETWORK_FLAG_DROP
authorPeter Müller <peter.mueller@ipfire.org>
Sun, 10 Oct 2021 17:13:38 +0000 (19:13 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Fri, 19 Nov 2021 06:02:43 +0000 (07:02 +0100)
This enables creating firewall rules using the special country code "XD"
for hostile networks safe to drop and ipinfo.cgi to display a meaningful
text for IP addresses having this flag set.

At the moment, the "LOC_NETWORK_FLAG_DROP" is not yet populated, but
will be in the future (as soon as libloc 0.9.9 is released and running
in production).

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/location-functions.pl

index fb97eb5892731810050434ca23b8971bdb815682..4d44ce24d3d0816f9d249a4f2e5fe2d381b0ed1d 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2020  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2021  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -29,6 +29,7 @@ my %not_iso_3166_location = (
        "A1" => "Anonymous Proxy",
        "A2" => "Satellite Provider",
        "A3" => "Worldwide Anycast Instance",
+       "XD" => "Hostile networks safe to drop",
 );
 
 # Hash which contains possible network flags and their mapped location codes.
@@ -36,10 +37,11 @@ my %network_flags = (
        "LOC_NETWORK_FLAG_ANONYMOUS_PROXY" => "A1",
        "LOC_NETWORK_FLAG_SATELLITE_PROVIDER" => "A2",
        "LOC_NETWORK_FLAG_ANYCAST" => "A3",
+       "LOC_NETWORK_FLAG_DROP" => "XD",
 );
 
 # Array which contains special country codes.
-my @special_locations = ( "A1", "A2", "A3" );
+my @special_locations = ( "A1", "A2", "A3", "XD" );
 
 # Directory where the libloc database and keyfile lives.
 our $location_dir = "/var/lib/location/";