else
return false;
- if (value != null)
+ if (value != null && value != undefined)
this.value = value;
return func.apply(this, args);
nomask ? _('valid IPv6 address') : _('valid IPv6 address or prefix'));
},
+ ip6ll(nomask) {
+ /* fe80::/10 -> 0xfe80 .. 0xfebf */
+ const x = parseInt(this.value, 16) | 0;
+ const isll = (((x & 0xffc0) ^ 0xfe80) === 0);
+
+ return this.assert(isll && this.apply('ip6addr', nomask),
+ _('valid IPv6 Link Local address'));
+ },
+
+ ip6ula(nomask) {
+ /* fd00::/8 -> 0xfd00 .. 0xfdff */
+ const x = parseInt(this.value, 16) | 0;
+ const isula = (((x & 0xfe00) ^ 0xfc00) === 0);
+
+ return this.assert(isula && this.apply('ip6addr', nomask),
+ _('valid IPv6 ULA address'));
+ },
+
ip4prefix() {
return this.assert(!isNaN(this.value) && this.value >= 0 && this.value <= 32,
_('valid IPv4 prefix value (0-32)'));