mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-13 09:09:58 +01:00
cli: add cidr6 data type
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
parent
b8407e6021
commit
706c416a30
1 changed files with 9 additions and 0 deletions
|
|
@ -190,6 +190,15 @@ const types = {
|
|||
return;
|
||||
}
|
||||
},
|
||||
cidr6: {
|
||||
parse: function(ctx, name, val) {
|
||||
let m = split(val, '/', 2);
|
||||
if (m && +m[1] <= 128 && length(iptoarr(m[0])) == 16)
|
||||
return val;
|
||||
ctx.invalid_argument("value for %s is not cidr6 (e.g. 2001:db8::1/64)", name);
|
||||
return;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return types;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue