static void ripng_instance_enable(struct ripng *ripng, struct vrf *vrf,
int sock);
static void ripng_instance_disable(struct ripng *ripng);
-int ripng_triggered_update(struct thread *);
+static void ripng_triggered_update(struct thread *);
static void ripng_if_rmap_update(struct if_rmap_ctx *ctx,
struct if_rmap *if_rmap);
}
/* RIPng route garbage collect timer. */
-static int ripng_garbage_collect(struct thread *t)
+static void ripng_garbage_collect(struct thread *t)
{
struct ripng_info *rinfo;
struct agg_node *rp;
/* Free RIPng routing information. */
ripng_info_free(rinfo);
-
- return 0;
}
static void ripng_timeout_update(struct ripng *ripng, struct ripng_info *rinfo);
}
/* Timeout RIPng routes. */
-static int ripng_timeout(struct thread *t)
+static void ripng_timeout(struct thread *t)
{
struct ripng_info *rinfo = THREAD_ARG(t);
struct ripng *ripng = ripng_info_get_instance(rinfo);
ripng_ecmp_delete(ripng, rinfo);
-
- return 0;
}
static void ripng_timeout_update(struct ripng *ripng, struct ripng_info *rinfo)
}
/* First entry point of reading RIPng packet. */
-static int ripng_read(struct thread *thread)
+static void ripng_read(struct thread *thread)
{
struct ripng *ripng = THREAD_ARG(thread);
int len;
if (len < 0) {
zlog_warn("RIPng recvfrom failed (VRF %s): %s.",
ripng->vrf_name, safe_strerror(errno));
- return len;
+ return;
}
/* Check RTE boundary. RTE size (Packet length - RIPng header size
zlog_warn("RIPng invalid packet size %d from %pI6 (VRF %s)",
len, &from.sin6_addr, ripng->vrf_name);
ripng_peer_bad_packet(ripng, &from);
- return 0;
+ return;
}
packet = (struct ripng_packet *)STREAM_DATA(ripng->ibuf);
zlog_warn(
"RIPng packet comes from unknown interface %d (VRF %s)",
ifindex, ripng->vrf_name);
- return 0;
+ return;
}
/* Packet version mismatch checking. */
"RIPng packet version %d doesn't fit to my version %d (VRF %s)",
packet->version, ripng->version, ripng->vrf_name);
ripng_peer_bad_packet(ripng, &from);
- return 0;
+ return;
}
/* Process RIPng packet. */
ripng_peer_bad_packet(ripng, &from);
break;
}
- return 0;
}
/* Walk down the RIPng routing table then clear changed flag. */
/* Regular update of RIPng route. Send all routing formation to RIPng
enabled interface. */
-static int ripng_update(struct thread *t)
+static void ripng_update(struct thread *t)
{
struct ripng *ripng = THREAD_ARG(t);
struct interface *ifp;
/* Reset flush event. */
ripng_event(ripng, RIPNG_UPDATE_EVENT, 0);
-
- return 0;
}
/* Triggered update interval timer. */
-static int ripng_triggered_interval(struct thread *t)
+static void ripng_triggered_interval(struct thread *t)
{
struct ripng *ripng = THREAD_ARG(t);
ripng->trigger = 0;
ripng_triggered_update(t);
}
- return 0;
}
/* Execute triggered update. */
-int ripng_triggered_update(struct thread *t)
+void ripng_triggered_update(struct thread *t)
{
struct ripng *ripng = THREAD_ARG(t);
struct interface *ifp;
thread_add_timer(master, ripng_triggered_interval, ripng, interval,
&ripng->t_triggered_interval);
-
- return 0;
}
/* Write routing table entry to the stream and return next index of
int socket;
ripng = ripng_lookup_by_vrf_name(vrf->name);
- if (!ripng) {
- char *old_vrf_name = NULL;
-
- ripng = (struct ripng *)vrf->info;
- if (!ripng)
- return 0;
- /* update vrf name */
- if (ripng->vrf_name)
- old_vrf_name = ripng->vrf_name;
- ripng->vrf_name = XSTRDUP(MTYPE_RIPNG_VRF_NAME, vrf->name);
- /*
- * HACK: Change the RIPng VRF in the running configuration directly,
- * bypassing the northbound layer. This is necessary to avoid deleting
- * the RIPng and readding it in the new VRF, which would have
- * several implications.
- */
- if (yang_module_find("frr-ripngd") && old_vrf_name) {
- struct lyd_node *ripng_dnode;
- char oldpath[XPATH_MAXLEN];
- char newpath[XPATH_MAXLEN];
-
- ripng_dnode = yang_dnode_getf(
- running_config->dnode,
- "/frr-ripngd:ripngd/instance[vrf='%s']/vrf",
- old_vrf_name);
- if (ripng_dnode) {
- yang_dnode_get_path(lyd_parent(ripng_dnode),
- oldpath, sizeof(oldpath));
- yang_dnode_change_leaf(ripng_dnode, vrf->name);
- yang_dnode_get_path(lyd_parent(ripng_dnode),
- newpath, sizeof(newpath));
- nb_running_move_tree(oldpath, newpath);
- running_config->version++;
- }
- }
- XFREE(MTYPE_RIPNG_VRF_NAME, old_vrf_name);
- }
-
- if (ripng->enabled)
+ if (!ripng || ripng->enabled)
return 0;
if (IS_RIPNG_DEBUG_EVENT)
void ripng_vrf_init(void)
{
vrf_init(ripng_vrf_new, ripng_vrf_enable, ripng_vrf_disable,
- ripng_vrf_delete, ripng_vrf_enable);
+ ripng_vrf_delete);
vrf_cmd_init(NULL);
}