aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-07-16 19:20:27 +0000
committerAsbjørn Sloth Tønnesen <ast@2e8.dk>2019-07-16 19:20:27 +0000
commita22e99c79588d6b7d8620ed061925230427e1635 (patch)
tree417f5fd31edfea2a8ad0d3e407b767bcd1163b3c
parent930296cfaadb49a8205231098502eaf20af2121a (diff)
downloadlua-inet-a22e99c79588d6b7d8620ed061925230427e1635.tar.gz
lua-inet-a22e99c79588d6b7d8620ed061925230427e1635.tar.xz
lua-inet-a22e99c79588d6b7d8620ed061925230427e1635.zip
add inet4:clone() for parity with inet6
Signed-off-by: Asbjørn Sloth Tønnesen <ast@2e8.dk>
-rw-r--r--lua/inet/init.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/inet/init.lua b/lua/inet/init.lua
index b91f845..ef8c5f2 100644
--- a/lua/inet/init.lua
+++ b/lua/inet/init.lua
@@ -321,6 +321,10 @@ function inet4:__pow(n)
return new_inet4(self.bip, self.mask + n)
end
+function inet4:clone()
+ return new_inet4(self.bip, self.mask)
+end
+
function inet4:contains(other)
if self.mask >= other.mask then
return false