1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: address: fix ifquery-check for ip(6)-forward 0/1 values

[18:18:12] root:~ # ifquery swp1
auto swp1
iface swp1
	ip-forward 0
	ip6-forward 0

[18:18:15] root:~ #
[18:18:16] root:~ # ifup swp1
[18:18:22] root:~ # echo $?
0
[18:18:23] root:~ # ifquery swp1 -c
auto swp1
iface swp1                                                          [pass]
	ip-forward off                                              [pass]
	ip6-forward off                                             [pass]

[18:18:27] root:~ #

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2018-07-16 13:03:47 +02:00
parent 007cae3525
commit 307e814c59

View File

@ -951,11 +951,13 @@ class address(moduleBase):
running_ipforward = self.read_file_oneline( running_ipforward = self.read_file_oneline(
'/proc/sys/net/ipv4/conf/%s/forwarding' '/proc/sys/net/ipv4/conf/%s/forwarding'
%ifaceobj.name) %ifaceobj.name)
running_ipforward = utils.get_onff_from_onezero( running_ipforward = utils.get_boolean_from_string(running_ipforward)
running_ipforward) config_ipforward = utils.get_boolean_from_string(ipforward)
ifaceobjcurr.update_config_with_status('ip-forward', ifaceobjcurr.update_config_with_status(
running_ipforward, 'ip-forward',
ipforward != running_ipforward) 'on' if running_ipforward else 'off',
running_ipforward != config_ipforward
)
ip6forward = ifaceobj.get_attr_value_first('ip6-forward') ip6forward = ifaceobj.get_attr_value_first('ip6-forward')
if ip6forward: if ip6forward:
@ -968,11 +970,13 @@ class address(moduleBase):
running_ip6forward = self.read_file_oneline( running_ip6forward = self.read_file_oneline(
'/proc/sys/net/ipv6/conf/%s/forwarding' '/proc/sys/net/ipv6/conf/%s/forwarding'
%ifaceobj.name) %ifaceobj.name)
running_ip6forward = utils.get_onff_from_onezero( running_ip6forward = utils.get_boolean_from_string(running_ip6forward)
running_ip6forward) config_ip6forward = utils.get_boolean_from_string(ip6forward)
ifaceobjcurr.update_config_with_status('ip6-forward', ifaceobjcurr.update_config_with_status(
running_ip6forward, 'ip6-forward',
ip6forward != running_ip6forward) 'on' if running_ip6forward else 'off',
running_ip6forward != config_ip6forward
)
mpls_enable = ifaceobj.get_attr_value_first('mpls-enable'); mpls_enable = ifaceobj.get_attr_value_first('mpls-enable');
if mpls_enable: if mpls_enable:
running_mpls_enable = self.read_file_oneline( running_mpls_enable = self.read_file_oneline(