]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_intra.c
Merge pull request #12329 from opensourcerouting/feature/graceful-shutdown_per_peer
[mirror_frr.git] / ospf6d / ospf6_intra.c
index 6626b4bed55409975706595c30115aacec7341b5..52bb745d74cfe6f1649fef8236065bd2dd86f289 100644 (file)
@@ -224,7 +224,7 @@ int ospf6_router_is_stub_router(struct ospf6_lsa *lsa)
        return OSPF6_NOT_STUB_ROUTER;
 }
 
-int ospf6_router_lsa_originate(struct thread *thread)
+void ospf6_router_lsa_originate(struct thread *thread)
 {
        struct ospf6_area *oa;
 
@@ -249,7 +249,7 @@ int ospf6_router_lsa_originate(struct thread *thread)
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug(
                                "Graceful Restart in progress, don't originate LSA");
-               return 0;
+               return;
        }
 
        if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
@@ -294,7 +294,7 @@ int ospf6_router_lsa_originate(struct thread *thread)
                                       + sizeof(struct ospf6_router_lsa)) {
                                zlog_warn(
                                        "Size limit setting for Router-LSA too short");
-                               return 0;
+                               return;
                        }
 
                        /* Fill LSA Header */
@@ -433,8 +433,6 @@ int ospf6_router_lsa_originate(struct thread *thread)
        if (count && !link_state_id)
                ospf6_spf_schedule(oa->ospf6,
                                   OSPF6_SPF_FLAGS_ROUTER_LSA_ORIGINATED);
-
-       return 0;
 }
 
 /*******************************/
@@ -511,7 +509,7 @@ static int ospf6_network_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
        return 0;
 }
 
-int ospf6_network_lsa_originate(struct thread *thread)
+void ospf6_network_lsa_originate(struct thread *thread)
 {
        struct ospf6_interface *oi;
 
@@ -538,7 +536,7 @@ int ospf6_network_lsa_originate(struct thread *thread)
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug(
                                "Graceful Restart in progress, don't originate LSA");
-               return 0;
+               return;
        }
 
        old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_NETWORK),
@@ -558,7 +556,7 @@ int ospf6_network_lsa_originate(struct thread *thread)
                                oi->area->ospf6,
                                OSPF6_SPF_FLAGS_NETWORK_LSA_ORIGINATED);
                }
-               return 0;
+               return;
        }
 
        if (IS_OSPF6_DEBUG_ORIGINATE(NETWORK))
@@ -577,7 +575,7 @@ int ospf6_network_lsa_originate(struct thread *thread)
                        zlog_debug("Interface stub, ignore");
                if (old)
                        ospf6_lsa_purge(old);
-               return 0;
+               return;
        }
 
        /* prepare buffer */
@@ -635,8 +633,6 @@ int ospf6_network_lsa_originate(struct thread *thread)
 
        /* Originate */
        ospf6_lsa_originate_area(lsa, oi->area);
-
-       return 0;
 }
 
 
@@ -765,7 +761,7 @@ static int ospf6_link_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
        return 0;
 }
 
-int ospf6_link_lsa_originate(struct thread *thread)
+void ospf6_link_lsa_originate(struct thread *thread)
 {
        struct ospf6_interface *oi;
 
@@ -785,7 +781,7 @@ int ospf6_link_lsa_originate(struct thread *thread)
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug(
                                "Graceful Restart in progress, don't originate LSA");
-               return 0;
+               return;
        }
 
 
@@ -797,7 +793,7 @@ int ospf6_link_lsa_originate(struct thread *thread)
        if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE)) {
                if (old)
                        ospf6_lsa_purge(old);
-               return 0;
+               return;
        }
 
        if (IS_OSPF6_DEBUG_ORIGINATE(LINK))
@@ -812,7 +808,7 @@ int ospf6_link_lsa_originate(struct thread *thread)
                                oi->interface->name);
                if (old)
                        ospf6_lsa_purge(old);
-               return 0;
+               return;
        }
 
        /* prepare buffer */
@@ -860,8 +856,6 @@ int ospf6_link_lsa_originate(struct thread *thread)
 
        /* Originate */
        ospf6_lsa_originate_interface(lsa, oi);
-
-       return 0;
 }
 
 
@@ -1003,7 +997,7 @@ static int ospf6_intra_prefix_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
        return 0;
 }
 
-int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
+void ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
 {
        struct ospf6_area *oa;
 
@@ -1028,7 +1022,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug(
                                "Graceful Restart in progress, don't originate LSA");
-               return 0;
+               return;
        }
 
        /* find previous LSA */
@@ -1051,7 +1045,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
                                        oa->lsdb);
                        }
                }
-               return 0;
+               return;
        }
 
        if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
@@ -1127,7 +1121,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
                        }
                }
                ospf6_route_table_delete(route_advertise);
-               return 0;
+               return;
        }
 
        /* Neighbor change to FULL, if INTRA-AREA-PREFIX LSA
@@ -1212,7 +1206,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
                if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
                        zlog_debug(
                                "Quit to Advertise Intra-Prefix: no route to advertise");
-               return 0;
+               return;
        }
 
        intra_prefix_lsa->prefix_num = htons(prefix_num);
@@ -1235,12 +1229,10 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
 
        /* Originate */
        ospf6_lsa_originate_area(lsa, oa);
-
-       return 0;
 }
 
 
-int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
+void ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
 {
        struct ospf6_interface *oi;
 
@@ -1268,7 +1260,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
                if (IS_DEBUG_OSPF6_GR)
                        zlog_debug(
                                "Graceful Restart in progress, don't originate LSA");
-               return 0;
+               return;
        }
 
        /* find previous LSA */
@@ -1279,7 +1271,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
        if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE)) {
                if (old)
                        ospf6_lsa_purge(old);
-               return 0;
+               return;
        }
 
        if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
@@ -1304,7 +1296,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
                        zlog_debug("  Interface is not DR");
                if (old)
                        ospf6_lsa_purge(old);
-               return 0;
+               return;
        }
 
        full_count = 0;
@@ -1317,7 +1309,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
                        zlog_debug("  Interface is stub");
                if (old)
                        ospf6_lsa_purge(old);
-               return 0;
+               return;
        }
 
        /* connected prefix to advertise */
@@ -1406,7 +1398,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
                if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
                        zlog_debug(
                                "Quit to Advertise Intra-Prefix: no route to advertise");
-               return 0;
+               return;
        }
 
        intra_prefix_lsa->prefix_num = htons(prefix_num);
@@ -1429,8 +1421,6 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread)
 
        /* Originate */
        ospf6_lsa_originate_area(lsa, oi->area);
-
-       return 0;
 }
 
 static void ospf6_intra_prefix_update_route_origin(struct ospf6_route *oa_route,
@@ -1775,10 +1765,8 @@ void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa)
        intra_prefix_lsa =
                (struct ospf6_intra_prefix_lsa *)OSPF6_LSA_HEADER_END(
                        lsa->header);
-       if (intra_prefix_lsa->ref_type == htons(OSPF6_LSTYPE_ROUTER))
-               ospf6_linkstate_prefix(intra_prefix_lsa->ref_adv_router,
-                                      intra_prefix_lsa->ref_id, &ls_prefix);
-       else if (intra_prefix_lsa->ref_type == htons(OSPF6_LSTYPE_NETWORK))
+       if (intra_prefix_lsa->ref_type == htons(OSPF6_LSTYPE_ROUTER) ||
+           intra_prefix_lsa->ref_type == htons(OSPF6_LSTYPE_NETWORK))
                ospf6_linkstate_prefix(intra_prefix_lsa->ref_adv_router,
                                       intra_prefix_lsa->ref_id, &ls_prefix);
        else {
@@ -2020,7 +2008,7 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa)
                        break;
                prefix_num--;
 
-               memset(&prefix, 0, sizeof(struct prefix));
+               memset(&prefix, 0, sizeof(prefix));
                prefix.family = AF_INET6;
                prefix.prefixlen = op->prefix_length;
                ospf6_prefix_in6_addr(&prefix.u.prefix6, intra_prefix_lsa, op);
@@ -2148,7 +2136,7 @@ static void ospf6_brouter_debug_print(struct ospf6_route *brouter)
        char installed[64], changed[64];
        struct timeval now, res;
        char id[16], adv_router[16];
-       char capa[16], options[16];
+       char capa[16], options[32];
 
        brouter_id = ADV_ROUTER_IN_PREFIX(&brouter->prefix);
        inet_ntop(AF_INET, &brouter_id, brouter_name, sizeof(brouter_name));