Comparison

util/ip.lua @ 8439:293dbb08427b

util.ip: Add CGNAT network range reserved in RFC 6598
author Kim Alvefur <zash@zash.se>
date Fri, 01 Dec 2017 03:13:52 +0100
parent 8438:499663bd0122
child 8441:e6e69be59233
comparison
equal deleted inserted replaced
8438:499663bd0122 8439:293dbb08427b
205 end 205 end
206 206
207 local rfc1918_8 = new_ip("10.0.0.0"); 207 local rfc1918_8 = new_ip("10.0.0.0");
208 local rfc1918_12 = new_ip("172.16.0.0"); 208 local rfc1918_12 = new_ip("172.16.0.0");
209 local rfc1918_16 = new_ip("192.168.0.0"); 209 local rfc1918_16 = new_ip("192.168.0.0");
210 local rfc6598 = new_ip("100.64.0.0");
210 211
211 function ip_methods:private() 212 function ip_methods:private()
212 local private = self.scope ~= 0xE; 213 local private = self.scope ~= 0xE;
213 if not private and self.proto == "IPv4" then 214 if not private and self.proto == "IPv4" then
214 private = match(self, rfc1918_8, 8) or match(self, rfc1918_12, 12) or match(self, rfc1918_16); 215 private = match(self, rfc1918_8, 8) or match(self, rfc1918_12, 12) or match(self, rfc1918_16) or match(self, rfc6598, 10);
215 end 216 end
216 self.private = private; 217 self.private = private;
217 return private; 218 return private;
218 end 219 end
219 220