summaryrefslogtreecommitdiff
path: root/src/conf_mode/igmp_proxy.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2020-11-27 13:45:21 +0700
committerGitHub <noreply@github.com>2020-11-27 13:45:21 +0700
commit1972691e7fe2a94e9f28e20b5eb5b404bff2dd19 (patch)
tree013f046489d3ce57e6358cf91990c43e9ee50562 /src/conf_mode/igmp_proxy.py
parent64d6e689a8274845a49e6931eda6cda04615de42 (diff)
parent5df05983c663f39953d4779086754416ab94f65f (diff)
downloadvyos-1x-1972691e7fe2a94e9f28e20b5eb5b404bff2dd19.tar.gz
vyos-1x-1972691e7fe2a94e9f28e20b5eb5b404bff2dd19.zip
Merge pull request #618 from DmitriyEshenko/fix-igmp-pim
pim: igmp: igmp-proxy: T2744: Add check to prevent pimd and igmp-prox…
Diffstat (limited to 'src/conf_mode/igmp_proxy.py')
-rwxr-xr-xsrc/conf_mode/igmp_proxy.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/conf_mode/igmp_proxy.py b/src/conf_mode/igmp_proxy.py
index 754f46566..d7d8ffd5e 100755
--- a/src/conf_mode/igmp_proxy.py
+++ b/src/conf_mode/igmp_proxy.py
@@ -33,6 +33,8 @@ config_file = r'/etc/igmpproxy.conf'
default_config_data = {
'disable': False,
'disable_quickleave': False,
+ 'igmp_conf': False,
+ 'pim_conf': False,
'interfaces': [],
}
@@ -42,6 +44,13 @@ def get_config(config=None):
conf = config
else:
conf = Config()
+
+ if conf.exists('protocols igmp'):
+ igmp_proxy['igmp_conf'] = True
+
+ if conf.exists('protocols pim'):
+ igmp_proxy['pim_conf'] = True
+
base = ['protocols', 'igmp-proxy']
if not conf.exists(base):
return None
@@ -125,11 +134,14 @@ def generate(igmp_proxy):
def apply(igmp_proxy):
if igmp_proxy is None or igmp_proxy['disable']:
- # IGMP Proxy support is removed in the commit
- call('systemctl stop igmpproxy.service')
- if os.path.exists(config_file):
- os.unlink(config_file)
+ # IGMP Proxy support is removed in the commit
+ call('systemctl stop igmpproxy.service')
+ if os.path.exists(config_file):
+ os.unlink(config_file)
else:
+ if igmp_proxy['igmp_conf'] or igmp_proxy['pim_conf']:
+ raise ConfigError('IGMP proxy and PIM cannot be both configured at the same time')
+
call('systemctl restart igmpproxy.service')
return None