summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libs/core/luasrc/ip.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/core/luasrc/ip.lua b/libs/core/luasrc/ip.lua
index 8ac017e022..0a66804e8e 100644
--- a/libs/core/luasrc/ip.lua
+++ b/libs/core/luasrc/ip.lua
@@ -159,6 +159,7 @@ function IPv4(address, netmask)
local data = {}
local prefix = address:match("/(.+)")
address = address:gsub("/.+","")
+ address = address:gsub("^%[(.*)%]$", "%1"):upper():gsub("^::FFFF:", "")
if netmask then
prefix = obj:prefix(netmask)
@@ -206,6 +207,7 @@ function IPv6(address, netmask)
local data = {}
local prefix = address:match("/(.+)")
address = address:gsub("/.+","")
+ address = address:gsub("^%[(.*)%]$", "%1")
if netmask then
prefix = obj:prefix(netmask)