summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-08-01 20:40:55 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-08-01 20:40:55 +0000
commit86cd67ebc31d8777b3e128f72c1133ea7c777439 (patch)
treee41f7e15135d767451baa0fd56367d714beb3cd3
parent68af07222ca541569d046d086c1f61510ca63a05 (diff)
[PATCH] make luci.ip.IPvX a bit more forgiving
Signed-Off-By: Malte S. Stretz <mss at apache.org>
-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)