projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* luci/libs: fix off-by-one bug in luci.ip
[project/luci.git]
/
libs
/
core
/
luasrc
/
ip.lua
diff --git
a/libs/core/luasrc/ip.lua
b/libs/core/luasrc/ip.lua
index e6de08f1b2c463db53cbdaf5bcc3bb1d69f03c11..2fe71297d9bcc6c5acc17f040faa95e2bbff28c0 100644
(file)
--- a/
libs/core/luasrc/ip.lua
+++ b/
libs/core/luasrc/ip.lua
@@
-333,7
+333,7
@@
function cidr.network( self, bits )
if #data < #self[2] then
table.insert( data, bit.band( self[2][1+#data], __mask16(bits) ) )
if #data < #self[2] then
table.insert( data, bit.band( self[2][1+#data], __mask16(bits) ) )
- for i = #data, #self[2] do
+ for i = #data
+ 1
, #self[2] do
table.insert( data, 0 )
end
end
table.insert( data, 0 )
end
end