+// 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>
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;
if (IS_DEBUG_OSPF6_GR)
zlog_debug(
"Graceful Restart in progress, don't originate LSA");
- return 0;
+ return;
}
if (IS_OSPF6_DEBUG_ORIGINATE(ROUTER))
+ sizeof(struct ospf6_router_lsa)) {
zlog_warn(
"Size limit setting for Router-LSA too short");
- return 0;
+ return;
}
/* Fill LSA Header */
if (count && !link_state_id)
ospf6_spf_schedule(oa->ospf6,
OSPF6_SPF_FLAGS_ROUTER_LSA_ORIGINATED);
-
- return 0;
}
/*******************************/
return 0;
}
-int ospf6_network_lsa_originate(struct thread *thread)
+void ospf6_network_lsa_originate(struct thread *thread)
{
struct ospf6_interface *oi;
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),
oi->area->ospf6,
OSPF6_SPF_FLAGS_NETWORK_LSA_ORIGINATED);
}
- return 0;
+ return;
}
if (IS_OSPF6_DEBUG_ORIGINATE(NETWORK))
zlog_debug("Interface stub, ignore");
if (old)
ospf6_lsa_purge(old);
- return 0;
+ return;
}
/* prepare buffer */
/* Originate */
ospf6_lsa_originate_area(lsa, oi->area);
-
- return 0;
}
return 0;
}
-int ospf6_link_lsa_originate(struct thread *thread)
+void ospf6_link_lsa_originate(struct thread *thread)
{
struct ospf6_interface *oi;
if (IS_DEBUG_OSPF6_GR)
zlog_debug(
"Graceful Restart in progress, don't originate LSA");
- return 0;
+ return;
}
if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE)) {
if (old)
ospf6_lsa_purge(old);
- return 0;
+ return;
}
if (IS_OSPF6_DEBUG_ORIGINATE(LINK))
oi->interface->name);
if (old)
ospf6_lsa_purge(old);
- return 0;
+ return;
}
/* prepare buffer */
/* Originate */
ospf6_lsa_originate_interface(lsa, oi);
-
- return 0;
}
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;
if (IS_DEBUG_OSPF6_GR)
zlog_debug(
"Graceful Restart in progress, don't originate LSA");
- return 0;
+ return;
}
/* find previous LSA */
oa->lsdb);
}
}
- return 0;
+ return;
}
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
}
}
ospf6_route_table_delete(route_advertise);
- return 0;
+ return;
}
/* Neighbor change to FULL, if INTRA-AREA-PREFIX LSA
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);
/* 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;
if (IS_DEBUG_OSPF6_GR)
zlog_debug(
"Graceful Restart in progress, don't originate LSA");
- return 0;
+ return;
}
/* find previous LSA */
if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE)) {
if (old)
ospf6_lsa_purge(old);
- return 0;
+ return;
}
if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX))
zlog_debug(" Interface is not DR");
if (old)
ospf6_lsa_purge(old);
- return 0;
+ return;
}
full_count = 0;
zlog_debug(" Interface is stub");
if (old)
ospf6_lsa_purge(old);
- return 0;
+ return;
}
/* connected prefix to advertise */
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);
/* Originate */
ospf6_lsa_originate_area(lsa, oi->area);
-
- return 0;
}
static void ospf6_intra_prefix_update_route_origin(struct ospf6_route *oa_route,
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 {
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);