From 2a6f176e415d9bb9ac5e33a3dbe2655b50273236 Mon Sep 17 00:00:00 2001 From: Sindhu Parvathi Gopinathan Date: Sat, 18 Mar 2023 11:48:34 -0700 Subject: [PATCH] zebra: add evpn isDetectionFreeze to json output Added "isDetectionFreeze" for show evpn json output to identify the default and freeze permanent config. Before fix:- ``` tor-2(config)# router bgp 65561 tor-2(config-router)# address-family l2vpn evpn tor-2(config-router)# address-family l2vpn evpn tor-2(config-router-af)# dup-addr-detection freeze permanent tor-2(config-router-af)# do show evpn L2 VNIs: 21 L3 VNIs: 5 Advertise gateway mac-ip: No Advertise svi mac-ip: No Advertise svi mac: No Duplicate address detection: Enable Detection max-moves 5, time 180 Detection freeze permanent EVPN MH: mac-holdtime: 1080s, neigh-holdtime: 1080s startup-delay: 180s, start-delay-timer: --:--:-- uplink-cfg-cnt: 0, uplink-active-cnt: 0 tor-2(config-router-af)# tor-2(config-router-af)# do show evpn json { "advertiseGatewayMacip":"No", "advertiseSviMacip":"No", "advertiseSviMac":"No", "numVnis":26, "numL2Vnis":21, "numL3Vnis":5, "isDuplicateAddrDetection":true, "maxMoves":5, "detectionTime":180, "detectionFreezeTime":0, "macHoldtime":1080, "neighHoldtime":1080, "startupDelay":180, "startupDelayTimer":"--:--:--", "uplinkConfigCount":0, "uplinkActiveCount":0 } tor-2(config-router-af)# ``` After fix:- ``` cumulus@tor-1:mgmt:~$ sudo vtysh -c "show evpn json" { "advertiseGatewayMacip":"No", "advertiseSviMacip":"No", "advertiseSviMac":"No", "numVnis":26, "numL2Vnis":21, "numL3Vnis":5, "isDuplicateAddrDetection":true, "maxMoves":5, "detectionTime":180, "detectionFreezeTime":0, ==> default case , i.e dad_freeze duration is 0 "isDetectionFreeze":false, ==> default case, i.e. dad_freeze disabled "macHoldtime":1080, "neighHoldtime":1080, "startupDelay":180, "startupDelayTimer":"--:--:--", "uplinkConfigCount":0, "uplinkActiveCount":0 } cumulus@tor-1:mgmt:~$ tor-1(config-router-af)# dup-addr-detection freeze permanent tor-1(config-router-af)# do show evpn json { "advertiseGatewayMacip":"No", "advertiseSviMacip":"No", "advertiseSviMac":"No", "numVnis":26, "numL2Vnis":21, "numL3Vnis":5, "isDuplicateAddrDetection":true, "maxMoves":5, "detectionTime":180, "detectionFreezeTime":0, ==> dad_freeze with duration permanent "isDetectionFreeze":true, ==> dad_freeze enabled "macHoldtime":1080, "neighHoldtime":1080, "startupDelay":180, "startupDelayTimer":"00:00:08", "uplinkConfigCount":0, "uplinkActiveCount":0, "protodownReasons":[ "startupDelay" ] } tor-1(config-router-af)# tor-1(config-router-af)# dup-addr-detection freeze 400 tor-1(config-router-af)# tor-1(config-router-af)# do show evpn json { "advertiseGatewayMacip":"No", "advertiseSviMacip":"No", "advertiseSviMac":"No", "numVnis":26, "numL2Vnis":21, "numL3Vnis":5, "isDuplicateAddrDetection":true, "maxMoves":5, "detectionTime":180, "detectionFreezeTime":400, ==> dad_freeze duration with numeric value "isDetectionFreeze":true, ==> dad_freeze enabled "macHoldtime":1080, "neighHoldtime":1080, "startupDelay":180, "startupDelayTimer":"00:00:47", "uplinkConfigCount":0, "uplinkActiveCount":0, "protodownReasons":[ "startupDelay" ] } tor-1(config-router-af)# no dup-addr-detection freeze permanent tor-1(config-router-af)# do show evpn json { "advertiseGatewayMacip":"No", "advertiseSviMacip":"No", "advertiseSviMac":"No", "numVnis":26, "numL2Vnis":21, "numL3Vnis":5, "isDuplicateAddrDetection":true, "maxMoves":5, "detectionTime":180, "detectionFreezeTime":0, ==> no dad_freeze duration "isDetectionFreeze":false, ==> no dad_freeze enabled "macHoldtime":1080, "neighHoldtime":1080, "startupDelay":180, "startupDelayTimer":"--:--:--", "uplinkConfigCount":0, "uplinkActiveCount":0 } tor-1(config-router-af)# ``` Ticket:#3404283 Issue:3404283 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's --- zebra/zebra_vxlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 19f1839ac7..153a5b8d8f 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3819,6 +3819,8 @@ void zebra_vxlan_print_evpn(struct vty *vty, bool uj) json_object_int_add(json, "detectionTime", zvrf->dad_time); json_object_int_add(json, "detectionFreezeTime", zvrf->dad_freeze_time); + json_object_boolean_add(json, "isDetectionFreeze", + zvrf->dad_freeze); zebra_evpn_mh_json(json); } else { vty_out(vty, "L2 VNIs: %u\n", num_l2vnis);