Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Fixed issue with string parse condition and rmoved unuses sed stateme…
Browse files Browse the repository at this point in the history
…nts from start_ebpf_router.py
  • Loading branch information
r-caamano committed Jan 22, 2024
1 parent 11c5238 commit f39d64c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. The format

-- Modified the "zfw -F" system call in start_ebpf_py.py to "zfw -F -r" to ensure that any ziti created loopback routes are also
cleared when restarting ziti-router.
-- Removed deprecated sed entries in start_ebpf_router.py that are no longer required
-- Fixed inaccurate string parse check in start_ebpf_router.py set_local_rules()

# [0.5.6] - 2024-01-19

Expand Down
7 changes: 2 additions & 5 deletions files/scripts/start_ebpf_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,13 @@ def get_if_ip(intf):
return ""

def set_local_rules(resolver):
default_cidr = '0.0.0.0/0'
default_ip = '0.0.0.0'
default_mask = '0'
if(len(resolver.split('/'))):
if(len(resolver.split('/')) == 2):
lan_ip = resolver.split('/')[0]
lan_mask = '32'
else:
lan_ip = default_cidr
lan_ip = default_ip
lan_mask = default_mask
add_edge_listener_rules(lan_ip, lan_mask)
add_link_listener_rules(lan_ip, lan_mask)
Expand Down Expand Up @@ -417,8 +416,6 @@ def set_local_rules(resolver):
if(os.path.exists('/etc/systemd/system/ziti-router.service') and router_config):
unconfigured = os.system("grep -r 'ExecStartPre\=\-\/opt/openziti\/bin\/start_ebpf_router.py' /etc/systemd/system/ziti-router.service")
if(unconfigured):
os.system("sed -i 's/ExecStartPre\=\-\/opt\/netfoundry\/ebpf\/objects\/etables \-F \-r/#ExecStartPre\=-\/opt\/netfoundry\/ebpf\/objects\/etables \-F \-r/g' /etc/systemd/system/ziti-router.service")
os.system("sed -i 's/ExecStartPre\=\-\/opt\/netfoundry\/ebpf\/scripts\/tproxy_splicer_startup.sh/#ExecStartPre\=\-\/opt\/netfoundry\/ebpf\/scripts\/tproxy_splicer_startup.sh/g' /etc/systemd/system/ziti-router.service")
test1 = 1
test1 = os.system("sed -i '/ExecStart=/i ExecStartPre\=\-\/opt\/openziti\/bin\/start_ebpf_router.py' /etc/systemd/system/ziti-router.service")
if(not test1):
Expand Down

0 comments on commit f39d64c

Please sign in to comment.