From: Donatas Abraitis Date: Tue, 8 Nov 2022 07:37:19 +0000 (+0200) Subject: ospf6d: Show if the interface is passive for `show ipv6 ospf6 interface` X-Git-Tag: base_8.5~260^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=93bae5f81f5598b88b684d601b023ed0d2fad2fa;p=matthieu%2Ffrr.git ospf6d: Show if the interface is passive for `show ipv6 ospf6 interface` donatas-pc# sh ipv6 ospf6 interface enp3s0 enp3s0 is up, type BROADCAST Interface ID: 2 Internet Address: inet : 192.168.10.17/24 inet6: fe80::ca5d:fd0d:cd8:1bb7/64 Instance ID 0, Interface MTU 1500 (autodetect: 1500) MTU mismatch detection: enabled Area ID 0.0.0.0, Cost 1000 State Waiting, Transmit Delay 1 sec, Priority 1 Timer intervals configured: Hello 10(8.149), Dead 40, Retransmit 5 DR: 0.0.0.0 BDR: 0.0.0.0 Number of I/F scoped LSAs is 1 0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off] 0 Pending LSAs for LSAck in Time 00:00:00 [thread off] Authentication Trailer is disabled donatas-pc# con donatas-pc(config)# int enp3s0 donatas-pc(config-if)# ipv6 ospf6 passive donatas-pc(config-if)# do sh ipv6 ospf6 interface enp3s0 enp3s0 is up, type BROADCAST Interface ID: 2 Internet Address: inet : 192.168.10.17/24 inet6: fe80::ca5d:fd0d:cd8:1bb7/64 Instance ID 0, Interface MTU 1500 (autodetect: 1500) MTU mismatch detection: enabled Area ID 0.0.0.0, Cost 1000 State Waiting, Transmit Delay 1 sec, Priority 1 Timer intervals configured: No Hellos (Passive interface) DR: 0.0.0.0 BDR: 0.0.0.0 Number of I/F scoped LSAs is 1 0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off] 0 Pending LSAs for LSAck in Time 00:00:00 [thread off] Authentication Trailer is disabled donatas-pc(config-if)# Signed-off-by: Donatas Abraitis --- diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 155374d3f0..63f51b8bd0 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1116,14 +1116,21 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp, oi->dead_interval); json_object_int_add(json_obj, "timerIntervalsConfigRetransmit", oi->rxmt_interval); + json_object_boolean_add( + json_obj, "timerPassiveIface", + !!CHECK_FLAG(oi->flag, OSPF6_INTERFACE_PASSIVE)); } else { vty_out(vty, " State %s, Transmit Delay %d sec, Priority %d\n", ospf6_interface_state_str[oi->state], oi->transdelay, oi->priority); vty_out(vty, " Timer intervals configured:\n"); - vty_out(vty, " Hello %d(%pTHd), Dead %d, Retransmit %d\n", - oi->hello_interval, oi->thread_send_hello, - oi->dead_interval, oi->rxmt_interval); + if (!CHECK_FLAG(oi->flag, OSPF6_INTERFACE_PASSIVE)) + vty_out(vty, + " Hello %d(%pTHd), Dead %d, Retransmit %d\n", + oi->hello_interval, oi->thread_send_hello, + oi->dead_interval, oi->rxmt_interval); + else + vty_out(vty, " No Hellos (Passive interface)\n"); } inet_ntop(AF_INET, &oi->drouter, drouter, sizeof(drouter));