summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index ffeb57784..d2fcf3121 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -126,6 +126,15 @@ def verify(tunnel):
if 'source_interface' in tunnel:
verify_interface_exists(tunnel['source_interface'])
+ # TTL != 0 and nopmtudisc are incompatible, parameters and ip use default
+ # values, thus the keys are always present.
+ if dict_search('parameters.ip.no_pmtu_discovery', tunnel) != None:
+ if dict_search('parameters.ip.ttl', tunnel) != '0':
+ raise ConfigError('Disabled PMTU requires TTL set to "0"!')
+ if tunnel['encapsulation'] in ['ipip6', 'ip6ip6', 'ip6gre']:
+ raise ConfigError('Can not disable PMTU discovery for given encapsulation')
+
+
def generate(tunnel):
return None
@@ -174,7 +183,10 @@ def apply(tunnel):
if tunnel['encapsulation'] in ['ipip6', 'ip6ip6', 'ip6gre']:
mappingv6 = {
# this : get_config()
- 'parameters.ipv6.encaplimit' : 'encaplimit'
+ 'parameters.ipv6.encaplimit' : 'encaplimit',
+ 'parameters.ipv6.flowlabel' : 'flowlabel',
+ 'parameters.ipv6.hoplimit' : 'hoplimit',
+ 'parameters.ipv6.tclass' : 'flowlabel'
}
mapping.update(mappingv6)
@@ -182,6 +194,11 @@ def apply(tunnel):
if dict_search(our_key, tunnel) and their_key in conf:
conf[their_key] = dict_search(our_key, tunnel)
+ if dict_search('parameters.ip.no_pmtu_discovery', tunnel) != None:
+ if 'pmtudisc' in conf['raw']:
+ conf['raw'].remove('pmtudisc')
+ conf['raw'].append('nopmtudisc')
+
tun = klass(tunnel['ifname'], **conf)
tun.change_options()
tun.update(tunnel)