Comparison

net/dns.lua @ 8440:4e6710b4f873

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 01 Dec 2017 04:54:23 +0100
parent 8427:1371518f70ff
parent 8421:3d21c63ec03f
child 8555:4f0f5b49bb03
comparison
equal deleted inserted replaced
8439:293dbb08427b 8440:4e6710b4f873
395 local b1, b2 = self:byte(2); 395 local b1, b2 = self:byte(2);
396 table.insert(addr, ("%02x%02x"):format(b1, b2)); 396 table.insert(addr, ("%02x%02x"):format(b1, b2));
397 end 397 end
398 addr = table.concat(addr, ":"):gsub("%f[%x]0+(%x)","%1"); 398 addr = table.concat(addr, ":"):gsub("%f[%x]0+(%x)","%1");
399 local zeros = {}; 399 local zeros = {};
400 for item in addr:gmatch(":[0:]+:") do 400 for item in addr:gmatch(":[0:]+:[0:]+:") do
401 table.insert(zeros, item) 401 table.insert(zeros, item)
402 end 402 end
403 if #zeros == 0 then 403 if #zeros == 0 then
404 rr.aaaa = addr; 404 rr.aaaa = addr;
405 return 405 return