aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/inet/init.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/inet/init.lua b/lua/inet/init.lua
index 99d1195..72677f9 100644
--- a/lua/inet/init.lua
+++ b/lua/inet/init.lua
@@ -18,7 +18,9 @@ function inet.new(ip, mask)
end
function inet:__len()
- return self.mask
+ local mask = self.mask
+ if mask == nil then return 0 end -- make metatable inspectable
+ return mask
end
local lshift = bit32.lshift