]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_interface.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ospf6d / ospf6_interface.c
index efa5d2b7ab91392ea02a4300d48a36594724efef..7a22fdf0641f96cd41524ba3a33f1fee567d3793 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2003 Yasuhiro Ohara
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -37,6 +22,7 @@
 #include "ospf6_route.h"
 #include "ospf6_area.h"
 #include "ospf6_abr.h"
+#include "ospf6_nssa.h"
 #include "ospf6_interface.h"
 #include "ospf6_neighbor.h"
 #include "ospf6_intra.h"
@@ -302,6 +288,9 @@ void ospf6_interface_delete(struct ospf6_interface *oi)
        /* disable from area list if possible */
        ospf6_area_interface_delete(oi);
 
+       if (oi->at_data.auth_key)
+               XFREE(MTYPE_OSPF6_AUTH_MANUAL_KEY, oi->at_data.auth_key);
+
        /* Free BFD allocated data. */
        XFREE(MTYPE_TMP, oi->bfd_config.profile);
 
@@ -966,10 +955,6 @@ static const char *ospf6_iftype_str(uint8_t iftype)
        return "UNKNOWN";
 }
 
-#if CONFDATE > 20220709
-CPP_NOTICE("Time to remove ospf6Enabled from JSON output")
-#endif
-
 /* show specified interface structure */
 static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                                json_object *json_obj, bool use_json)
@@ -996,11 +981,8 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                                       ospf6_iftype_str(default_iftype));
                json_object_int_add(json_obj, "interfaceId", ifp->ifindex);
 
-               if (ifp->info == NULL) {
-                       json_object_boolean_false_add(json_obj, "ospf6Enabled");
+               if (ifp->info == NULL)
                        return 0;
-               }
-               json_object_boolean_true_add(json_obj, "ospf6Enabled");
 
                oi = (struct ospf6_interface *)ifp->info;
 
@@ -1123,14 +1105,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));
@@ -1241,7 +1230,8 @@ static int ospf6_interface_show(struct vty *vty, struct interface *ifp,
                }
        }
 
-       json_auth = json_object_new_object();
+       if (use_json)
+               json_auth = json_object_new_object();
        if (oi->at_data.flags != 0) {
                if (use_json) {
                        if (CHECK_FLAG(oi->at_data.flags,
@@ -1719,8 +1709,11 @@ void ospf6_interface_start(struct ospf6_interface *oi)
        if (oi->area_id_format == OSPF6_AREA_FMT_UNSET)
                return;
 
-       if (oi->area)
+       if (oi->area) {
+               /* Recompute cost */
+               ospf6_interface_recalculate_cost(oi);
                return;
+       }
 
        ospf6 = oi->interface->vrf->info;
        if (!ospf6)
@@ -1740,8 +1733,10 @@ void ospf6_interface_start(struct ospf6_interface *oi)
        ospf6_interface_enable(oi);
 
        /* If the router is ABR, originate summary routes */
-       if (ospf6_check_and_set_router_abr(ospf6))
+       if (ospf6_check_and_set_router_abr(ospf6)) {
                ospf6_abr_enable_area(oa);
+               ospf6_schedule_abr_task(ospf6);
+       }
 }
 
 void ospf6_interface_stop(struct ospf6_interface *oi)