Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
!
{% endblock banner %}
!
{% block zebra_nexthop %}
{% if (('localhost' in DEVICE_METADATA) and ('zebra_nexthop' in DEVICE_METADATA['localhost']) and
(DEVICE_METADATA['localhost']['zebra_nexthop'] == 'enabled')) %}
Comment on lines +10 to +11

Copilot AI Oct 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The condition checks are duplicated between the zebra_nexthop block (lines 10-11) and the existing fpm block (lines 20-21). Consider extracting the metadata access pattern into a Jinja variable for better maintainability and consistency.

Copilot uses AI. Check for mistakes.
zebra nexthop kernel enable
{% else %}
! Force disable next hop group support
no zebra nexthop kernel enable
{% endif %}
{% endblock zebra_nexthop %}
!
{% block fpm %}
{% if ( ('localhost' in DEVICE_METADATA) and ('nexthop_group' in DEVICE_METADATA['localhost']) and
(DEVICE_METADATA['localhost']['nexthop_group'] == 'enabled') ) %}
Expand Down
3 changes: 1 addition & 2 deletions platform/vs/docker-sonic-vs/frr/zebra.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
no zebra nexthop kernel enable
no fpm use-next-hop-groups

fpm address 127.0.0.1
zebra nexthop-group keep 1

3 changes: 3 additions & 0 deletions src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
Comment thread
lipxu marked this conversation as resolved.
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
! file: zebra.conf
!
!
! Force disable next hop group support
no zebra nexthop kernel enable
!
! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages
no fpm use-next-hop-groups
!
Expand Down
3 changes: 2 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@
"bgp_router_id": "8.8.8.8",
"chassis_hostname": "str-sonic-chassis-1",
"slice_type": "AZNG_Production",
"nexthop_group": "disabled"
"nexthop_group": "disabled",
"zebra_nexthop": "disabled"
}
},
"VLAN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@
"DEVICE_METADATA_VALID_NEXTHOP_GROUP": {
"desc": "Verifying nexthop_group configuration."
},
"DEVICE_METADATA_VALID_ZEBRA_NEXTHOP": {
"desc": "Verifying valid zebra_nexthop configuration."
},
"DEVICE_METADATA_VALID_T2_GROUP_ASNS": {
"desc": "Verifying valid t2_group_asns."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,5 +804,14 @@
}
}
}
},
"DEVICE_METADATA_VALID_ZEBRA_NEXTHOP": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"zebra_nexthop": "disabled"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ module sonic-device_metadata {
type stypes:boolean_type;
default "false";
}

leaf zebra_nexthop {
description "Enable or disable next hop group support. This value only takes effect during boot time";
type enumeration {
enum enabled;
enum disabled;
}
default disabled;
}
}
/* end of container localhost */
}
Expand Down
Loading