29d087
From 03668eda9ccb4be25fd7b3962975397eff44bfe5 Mon Sep 17 00:00:00 2001
29d087
From: David Moss <drkjam@gmail.com>
29d087
Date: Thu, 27 Aug 2015 08:01:02 +0100
29d087
Subject: [PATCH] - Fixed #71. Updated IPv4 reserved networks.
29d087
29d087
---
29d087
 netaddr/ip/__init__.py | 28 +++++++++++++++-------------
29d087
 1 file changed, 15 insertions(+), 13 deletions(-)
29d087
29d087
diff --git a/netaddr/ip/__init__.py b/netaddr/ip/__init__.py
29d087
index 0f7a93e22c3f8d63842fd6cecedabd6564d711b3..5537f5fec94016a17f9ef653f940fb8ea95a2365 100644
29d087
--- a/netaddr/ip/__init__.py
29d087
+++ b/netaddr/ip/__init__.py
29d087
@@ -1901,14 +1901,15 @@ def all_matching_cidrs(ip, cidrs):
29d087
 #-----------------------------------------------------------------------------
29d087
 #   Cached IPv4 address range lookups.
29d087
 #-----------------------------------------------------------------------------
29d087
-IPV4_LOOPBACK  = IPNetwork('127.0.0.0/8')
29d087
+IPV4_LOOPBACK  = IPNetwork('127.0.0.0/8')    #   Loopback addresses (RFC 990)
29d087
 
29d087
 IPV4_PRIVATE = (
29d087
-    IPNetwork('10.0.0.0/8'),                    #   Private-Use Networks
29d087
-    IPNetwork('100.64.0.0/10'),                 #   Shared address space
29d087
-    IPNetwork('172.16.0.0/12'),                 #   Private-Use Networks
29d087
-    IPNetwork('192.0.2.0/24'),                  #   Test-Net
29d087
-    IPNetwork('192.168.0.0/16'),                #   Private-Use Networks
29d087
+    IPNetwork('10.0.0.0/8'),        #   Class A private network local communication (RFC 1918)
29d087
+    IPNetwork('100.64.0.0/10'),     #   Carrier grade NAT (RFC 6598)
29d087
+    IPNetwork('172.16.0.0/12'),     #   Private network - local communication (RFC 1918)
29d087
+    IPNetwork('192.0.0.0/24'),      #   IANA IPv4 Special Purpose Address Registry (RFC 5736)
29d087
+    IPNetwork('192.168.0.0/16'),    #   Class B private network local communication (RFC 1918)
29d087
+    IPNetwork('198.18.0.0/15'),     #  Testing of inter-network communications between subnets (RFC 2544)
29d087
     IPRange('239.0.0.0', '239.255.255.255'),    #   Administrative Multicast
29d087
 )
29d087
 
29d087
@@ -1916,19 +1917,20 @@ IPV4_LINK_LOCAL = IPNetwork('169.254.0.0/16')
29d087
 
29d087
 IPV4_MULTICAST = IPNetwork('224.0.0.0/4')
29d087
 
29d087
-IPV4_6TO4 = IPNetwork('192.88.99.0/24')    #   6to4 Relay Anycast
29d087
+IPV4_6TO4 = IPNetwork('192.88.99.0/24')    #   6to4 anycast relays (RFC 3068)
29d087
 
29d087
 IPV4_RESERVED = (
29d087
-    IPNetwork('192.0.0.0/24'),      #   Reserved but subject to allocation
29d087
-    IPNetwork('240.0.0.0/4'),       #   Reserved for Future Use
29d087
-    IPNetwork('198.18.0.0/15'),     #   Benchmarking
29d087
-    IPNetwork('198.51.100.0/24'),   #   Examples for documentation
29d087
-    IPNetwork('203.0.113.0/24'),    #   Examples for documentation
29d087
+    IPNetwork('0.0.0.0/8'),         #   Broadcast message (RFC 1700)
29d087
+    IPNetwork('192.0.2.0/24'),      #   TEST-NET examples and documentation (RFC 5737)
29d087
+    IPNetwork('240.0.0.0/4'),       #   Reserved for  multicast assignments (RFC 5771)
29d087
+    IPNetwork('198.51.100.0/24'),   #   TEST-NET-2 examples and documentation (RFC 5737)
29d087
+    IPNetwork('203.0.113.0/24'),    #   TEST-NET-3 examples and documentation (RFC 5737)
29d087
 
29d087
     #   Reserved multicast
29d087
+    IPNetwork('233.252.0.0/24'),    #   Multicast test network
29d087
     IPRange('234.0.0.0', '238.255.255.255'),
29d087
     IPRange('225.0.0.0', '231.255.255.255'),
29d087
-)
29d087
+) + (IPV4_LOOPBACK, IPV4_6TO4)
29d087
 
29d087
 #-----------------------------------------------------------------------------
29d087
 #   Cached IPv6 address range lookups.
29d087
-- 
29d087
2.9.5
29d087