summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/services/protocols/vrrp/event.py2
-rw-r--r--ryu/services/protocols/vrrp/router.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/ryu/services/protocols/vrrp/event.py b/ryu/services/protocols/vrrp/event.py
index 49d36924..1eb4426b 100644
--- a/ryu/services/protocols/vrrp/event.py
+++ b/ryu/services/protocols/vrrp/event.py
@@ -115,6 +115,7 @@ class VRRPConfig(object):
advertmisement_interval is in seconds as float. (Not in centiseconds)
"""
def __init__(self, version=vrrp.VRRP_VERSION_V3, vrid=None,
+ admin_state=None,
priority=vrrp.VRRP_PRIORITY_BACKUP_DEFAULT, ip_addresses=None,
advertisement_interval=vrrp.VRRP_MAX_ADVER_INT_DEFAULT_IN_SEC,
preempt_mode=True, preempt_delay=0, accept_mode=False):
@@ -124,6 +125,7 @@ class VRRPConfig(object):
super(VRRPConfig, self).__init__()
self.version = version
+ self.admin_state = admin_state
self.vrid = vrid
self.priority = priority
self.ip_addresses = ip_addresses
diff --git a/ryu/services/protocols/vrrp/router.py b/ryu/services/protocols/vrrp/router.py
index 601c91b5..88b6ce9f 100644
--- a/ryu/services/protocols/vrrp/router.py
+++ b/ryu/services/protocols/vrrp/router.py
@@ -657,7 +657,9 @@ class VRRPRouterV3(VRRPRouter):
def start(self):
self.state_change(vrrp_event.VRRP_STATE_INITIALIZE)
- if self.config.address_owner:
+ # Check role here and change accordingly
+ # Check config.admin_state
+ if self.config.address_owner or self.config.admin_state == 'master':
self.send_advertisement()
# This action should be done router on