diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-02-20 11:54:36 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-02-20 11:54:36 +0000 |
commit | ac821d0d1764e9623015e04c5158a06c00ab370b (patch) | |
tree | d34eead42836f9cbb23202972d6eeead2e81cc25 /python/vyos | |
parent | 75c741d5d4fcd9fd07077601106532c41ad9b118 (diff) | |
download | vyos-1x-ac821d0d1764e9623015e04c5158a06c00ab370b.tar.gz vyos-1x-ac821d0d1764e9623015e04c5158a06c00ab370b.zip |
T5007: Fix multicast implementation for the tunnel interfaces
Multicast has not been implemented for the tunnel interfaces.
We have only configuration CLI commands that do anything.
Fix it.
ip link set dev <tag> multicast on
ip link set dev <tag> multicast off
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/ifconfig/tunnel.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index 5258a2cb1..f776240a1 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -162,6 +162,15 @@ class TunnelIf(Interface): """ Get a synthetic MAC address. """ return self.get_mac_synthetic() + def set_multicast(self): + """ Set multicast """ + if self.config.get('multicast', 'disable') == 'enable': + cmd = 'ip link set dev {ifname} multicast on' + else: + cmd = 'ip link set dev {ifname} multicast off' + + self._cmd(cmd.format(**self.config)) + def update(self, config): """ General helper function which works on a dictionary retrived by get_config_dict(). It's main intention is to consolidate the scattered @@ -170,5 +179,8 @@ class TunnelIf(Interface): # Adjust iproute2 tunnel parameters if necessary self._change_options() + # Add multicast + self.set_multicast() + # call base class first super().update(config) |