validation of an ip if an ip term starts with a zero
This commit is contained in:
@@ -786,6 +786,12 @@ class IPOption(Option):
|
||||
warnings_only=warnings_only)
|
||||
|
||||
def _validate(self, value):
|
||||
# sometimes an ip term starts with a zero
|
||||
# but this does not fit in some case, for example bind does not like it
|
||||
for val in value.split('.'):
|
||||
if val.startswith("0") and len(val)>1:
|
||||
raise ValueError(_('invalid IP'))
|
||||
# 'standard' validation
|
||||
try:
|
||||
IP('{0}/32'.format(value))
|
||||
except ValueError:
|
||||
|
Reference in New Issue
Block a user