added validation checks/conversion for valid values of mac addresses and ip addresses to addaddr and sethwaddr functions
This commit is contained in:
parent
de493c810a
commit
6042c6fed9
4 changed files with 51 additions and 6 deletions
|
@ -114,7 +114,7 @@ class CoreInterface:
|
|||
:param str addr: address to add
|
||||
:return: nothing
|
||||
"""
|
||||
|
||||
addr = utils.validate_ip(addr)
|
||||
self.addrlist.append(addr)
|
||||
|
||||
def deladdr(self, addr):
|
||||
|
@ -133,6 +133,7 @@ class CoreInterface:
|
|||
:param str addr: hardware address to set to.
|
||||
:return: nothing
|
||||
"""
|
||||
addr = utils.validate_mac(addr)
|
||||
self.hwaddr = addr
|
||||
|
||||
def getparam(self, key):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue