Skip to content

Commit 5131fc9

Browse files
committed
implement staticroutebfd process
1 parent e6fde1d commit 5131fc9

File tree

7 files changed

+686
-1
lines changed

7 files changed

+686
-1
lines changed

dockers/docker-fpm-frr/frr/supervisord/critical_processes.j2

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ program:pimd
99
program:frrcfgd
1010
{%- else %}
1111
program:bgpcfgd
12+
program:staticroutebfd
1213
{%- endif %}

dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2

+14
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ stderr_logfile=syslog
141141
dependent_startup=true
142142
dependent_startup_wait_for=bgpd:running
143143

144+
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
145+
{% else %}
146+
[program:staticroutebfd]
147+
command=/usr/local/bin/staticroutebfd
148+
priority=6
149+
autostart=false
150+
autorestart=false
151+
startsecs=0
152+
stdout_logfile=syslog
153+
stderr_logfile=syslog
154+
dependent_startup=true
155+
dependent_startup_wait_for=bgpd:running
156+
{% endif %}
157+
144158
[program:bgpmon]
145159
command=/usr/local/bin/bgpmon
146160
priority=6

src/sonic-bgpcfgd/bgpcfgd/log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def log_err(msg):
3030

3131
def log_crit(msg):
3232
""" Send a message msg to the syslog as CRIT """
33-
syslog.syslog(syslog.LOG_CRIT, msg)
33+
syslog.syslog(syslog.LOG_CRIT, msg)

src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py

+5
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ def set_handler(self, key, data):
4141
intf_list = arg_list(data['ifname']) if 'ifname' in data else None
4242
dist_list = arg_list(data['distance']) if 'distance' in data else None
4343
nh_vrf_list = arg_list(data['nexthop-vrf']) if 'nexthop-vrf' in data else None
44+
bfd_enable = arg_list(data['bfd']) if 'bfd' in data else None
4445
route_tag = self.ROUTE_ADVERTISE_DISABLE_TAG if 'advertise' in data and data['advertise'] == "false" else self.ROUTE_ADVERTISE_ENABLE_TAG
4546

47+
# bfd enabled route would be handled in staticroutebfd, skip here
48+
if bfd_enable and bfd_enable[0].lower() == "true":
49+
return True
50+
4651
try:
4752
ip_nh_set = IpNextHopSet(is_ipv6, bkh_list, nh_list, intf_list, dist_list, nh_vrf_list)
4853
cur_nh_set, cur_route_tag = self.static_routes.get(vrf, {}).get(ip_prefix, (IpNextHopSet(is_ipv6), route_tag))

src/sonic-bgpcfgd/setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
entry_points = {
1212
'console_scripts': [
1313
'bgpcfgd = bgpcfgd.main:main',
14+
'staticroutebfd = staticroutebfd.main:main',
1415
'bgpmon = bgpmon.bgpmon:main',
1516
]
1617
},

src/sonic-bgpcfgd/staticroutebfd/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)