]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf6d: Show if the interface is passive for `show ipv6 ospf6 interface`
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 8 Nov 2022 07:37:19 +0000 (09:37 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 8 Nov 2022 07:37:19 +0000 (09:37 +0200)
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 <donatas@opensourcerouting.org>
ospf6d/ospf6_interface.c

index 155374d3f0b35f224d4ef84dc6e98c6976d823bd..63f51b8bd096127b64d92ddce737354275c6b2bf 100644 (file)
@@ -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));