Commit 1f494cff authored by Mark Schouten's avatar Mark Schouten

For a vlan, if the parent is down, we are not allowed to set the vlan to UP

parent a271ce36
......@@ -243,7 +243,12 @@ def Addaddr(iface, addr):
def Ifstate(iface, state):
print("Setting state of interface %s to %s" % (iface, state))
global ip
from pprint import pprint
i = ip.interfaces[iface]
if i['kind'] == 'vlan':
p = ip.interfaces[i['link']]
if p['operstate'] == 'DOWN' and state == 'UP':
return
if state == 'UP':
i.up()
if state == 'DOWN':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment