aboutsummaryrefslogtreecommitdiffstats
path: root/lua/inet/core.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/inet/core.lua')
-rw-r--r--lua/inet/core.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/inet/core.lua b/lua/inet/core.lua
index f9ff6e1..f3ae228 100644
--- a/lua/inet/core.lua
+++ b/lua/inet/core.lua
@@ -12,6 +12,8 @@ local bxor = bit32.bxor
local get_mt = common.get_mt
+local mixed_networks
+
local mt2fam = {}
local inet = {}
@@ -428,7 +430,7 @@ local function tostr6(self, withmask, embeddedipv4)
local zeros = {}
if embeddedipv4 == nil then
- embeddedipv4 = false -- TODO check if well-known prefix
+ embeddedipv4 = mixed_networks:contains(self)
end
local ipv6pieces = 8
@@ -674,6 +676,10 @@ end
local M = {}
+function M.set_mixed_networks(mixed_set)
+ mixed_networks = mixed_set
+end
+
M.is_inet4 = is_inet4
M.is_inet6 = is_inet6
M.is_inet = is_inet