mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
readd support for self.ipforward
if user want to setup default forwarding with a global policy
This commit is contained in:
@@ -716,6 +716,11 @@ class address(moduleBase):
|
|||||||
'bridge port' %ifaceobj.name)
|
'bridge port' %ifaceobj.name)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
setting_default_value = False
|
||||||
|
if not ipforward:
|
||||||
|
setting_default_value = True
|
||||||
|
ipforward = self.ipforward
|
||||||
|
|
||||||
if ipforward:
|
if ipforward:
|
||||||
ipforward = utils.boolean_support_binary(ipforward)
|
ipforward = utils.boolean_support_binary(ipforward)
|
||||||
# File read has been used for better performance
|
# File read has been used for better performance
|
||||||
@@ -731,9 +736,16 @@ class address(moduleBase):
|
|||||||
%('/'.join(ifaceobj.name.split("."))),
|
%('/'.join(ifaceobj.name.split("."))),
|
||||||
ipforward)
|
ipforward)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
if not setting_default_value:
|
||||||
ifaceobj.status = ifaceStatus.ERROR
|
ifaceobj.status = ifaceStatus.ERROR
|
||||||
self.logger.error('%s: %s' %(ifaceobj.name, str(e)))
|
self.logger.error('%s: %s' %(ifaceobj.name, str(e)))
|
||||||
|
|
||||||
|
|
||||||
|
setting_default_value = False
|
||||||
|
if not ip6forward:
|
||||||
|
setting_default_value = True
|
||||||
|
ip6forward = self.ip6forward
|
||||||
|
|
||||||
if ip6forward:
|
if ip6forward:
|
||||||
ip6forward = utils.boolean_support_binary(ip6forward)
|
ip6forward = utils.boolean_support_binary(ip6forward)
|
||||||
# File read has been used for better performance
|
# File read has been used for better performance
|
||||||
@@ -751,6 +763,7 @@ class address(moduleBase):
|
|||||||
# for example, setting mtu < 1280
|
# for example, setting mtu < 1280
|
||||||
# In such cases, log error only if user has configured
|
# In such cases, log error only if user has configured
|
||||||
# ip6-forward
|
# ip6-forward
|
||||||
|
if not setting_default_value:
|
||||||
ifaceobj.status = ifaceStatus.ERROR
|
ifaceobj.status = ifaceStatus.ERROR
|
||||||
self.logger.error('%s: %s' %(ifaceobj.name, str(e)))
|
self.logger.error('%s: %s' %(ifaceobj.name, str(e)))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user