forked from Mirror/frr
ospf6d part of 6Wind patch.
This commit is contained in:
parent
595db7f165
commit
e26bbebadd
|
@ -28,7 +28,7 @@ noinst_HEADERS = \
|
||||||
ospf6d_SOURCES = \
|
ospf6d_SOURCES = \
|
||||||
ospf6_main.c $(libospf6_a_SOURCES)
|
ospf6_main.c $(libospf6_a_SOURCES)
|
||||||
|
|
||||||
ospf6d_LDADD = ../lib/libzebra.a
|
ospf6d_LDADD = -L../lib -lzebra
|
||||||
|
|
||||||
sysconf_DATA = ospf6d.conf.sample
|
sysconf_DATA = ospf6d.conf.sample
|
||||||
|
|
||||||
|
|
|
@ -412,8 +412,9 @@ ospf6_asbr_external_lsa_refresh (void *data)
|
||||||
struct ospf6_lsa_as_external *e;
|
struct ospf6_lsa_as_external *e;
|
||||||
struct prefix prefix;
|
struct prefix prefix;
|
||||||
struct route_node *node;
|
struct route_node *node;
|
||||||
struct ospf6_external_route *route;
|
struct ospf6_external_route *route = NULL;
|
||||||
struct ospf6_external_info *info;
|
struct ospf6_external_info *info = NULL;
|
||||||
|
struct ospf6_external_info *match = NULL;
|
||||||
|
|
||||||
if (IS_OSPF6_DUMP_ASBR)
|
if (IS_OSPF6_DUMP_ASBR)
|
||||||
zlog_info ("ASBR: refresh %s", lsa->str);
|
zlog_info ("ASBR: refresh %s", lsa->str);
|
||||||
|
@ -424,6 +425,29 @@ ospf6_asbr_external_lsa_refresh (void *data)
|
||||||
prefix.family = AF_INET6;
|
prefix.family = AF_INET6;
|
||||||
apply_mask_ipv6 ((struct prefix_ipv6 *) &prefix);
|
apply_mask_ipv6 ((struct prefix_ipv6 *) &prefix);
|
||||||
|
|
||||||
|
for (node = route_top (external_table); node; node = route_next (node))
|
||||||
|
{
|
||||||
|
route = node->info;
|
||||||
|
if (route == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (info = route->info_head; info; info = info->next)
|
||||||
|
{
|
||||||
|
if (lsa->header->id == htonl (info->id))
|
||||||
|
match = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match == NULL)
|
||||||
|
{
|
||||||
|
ospf6_lsa_premature_aging (lsa);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ospf6_asbr_schedule_external (match);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if 0
|
||||||
node = route_node_lookup (external_table, &prefix);
|
node = route_node_lookup (external_table, &prefix);
|
||||||
if (! node || ! node->info)
|
if (! node || ! node->info)
|
||||||
{
|
{
|
||||||
|
@ -450,6 +474,7 @@ ospf6_asbr_external_lsa_refresh (void *data)
|
||||||
ospf6_lsa_premature_aging (lsa);
|
ospf6_lsa_premature_aging (lsa);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -461,6 +486,18 @@ ospf6_asbr_route_add (int type, int ifindex, struct prefix *prefix,
|
||||||
struct ospf6_external_route *route;
|
struct ospf6_external_route *route;
|
||||||
struct ospf6_external_info *info, tinfo;
|
struct ospf6_external_info *info, tinfo;
|
||||||
|
|
||||||
|
#if defined (MUSICA) || defined (LINUX)
|
||||||
|
/* XXX As long as the OSPFv3 redistribution is applied to all the connected
|
||||||
|
* routes, one needs to filter the ::/96 prefixes.
|
||||||
|
* However it could be a wanted case, it will be removed soon.
|
||||||
|
*/
|
||||||
|
struct prefix_ipv6 *p = (prefix_ipv6 *)prefix;
|
||||||
|
|
||||||
|
if ((IN6_IS_ADDR_V4COMPAT(&p->prefix)) ||
|
||||||
|
(IN6_IS_ADDR_UNSPECIFIED (&p->prefix) && (p->prefixlen == 96)))
|
||||||
|
return;
|
||||||
|
#endif /* MUSICA or LINUX */
|
||||||
|
|
||||||
if (! ospf6_zebra_is_redistribute (type))
|
if (! ospf6_zebra_is_redistribute (type))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -567,6 +604,18 @@ ospf6_asbr_route_remove (int type, int ifindex, struct prefix *prefix)
|
||||||
struct ospf6_external_info *info;
|
struct ospf6_external_info *info;
|
||||||
struct ospf6_lsa *lsa;
|
struct ospf6_lsa *lsa;
|
||||||
|
|
||||||
|
#if defined (MUSICA) || defined (LINUX)
|
||||||
|
/* XXX As long as the OSPFv3 redistribution is applied to all the connected
|
||||||
|
* routes, one needs to filter the ::/96 prefixes.
|
||||||
|
* However it could be a wanted case, it will be removed soon.
|
||||||
|
*/
|
||||||
|
struct prefix_ipv6 *p = (prefix_ipv6 *)prefix;
|
||||||
|
|
||||||
|
if ((IN6_IS_ADDR_V4COMPAT(&p->prefix)) ||
|
||||||
|
(IN6_IS_ADDR_UNSPECIFIED (&p->prefix) && (p->prefixlen == 96)))
|
||||||
|
return;
|
||||||
|
#endif /* MUSICA or LINUX */
|
||||||
|
|
||||||
node = route_node_get (external_table, prefix);
|
node = route_node_get (external_table, prefix);
|
||||||
route = node->info;
|
route = node->info;
|
||||||
|
|
||||||
|
|
|
@ -283,10 +283,10 @@ main (int argc, char *argv[], char *envp[])
|
||||||
if (! daemon_mode)
|
if (! daemon_mode)
|
||||||
flag = ZLOG_STDOUT;
|
flag = ZLOG_STDOUT;
|
||||||
else
|
else
|
||||||
flag = 0;
|
flag = ZLOG_NOLOG;
|
||||||
|
|
||||||
zlog_default = openzlog (progname, flag, ZLOG_OSPF6,
|
zlog_default = openzlog (progname, flag, ZLOG_OSPF6,
|
||||||
LOG_CONS|LOG_NDELAY|LOG_PERROR|LOG_PID,
|
LOG_CONS|LOG_NDELAY|LOG_PID,
|
||||||
LOG_DAEMON);
|
LOG_DAEMON);
|
||||||
signal_init ();
|
signal_init ();
|
||||||
cmd_init (1);
|
cmd_init (1);
|
||||||
|
@ -315,9 +315,11 @@ main (int argc, char *argv[], char *envp[])
|
||||||
/* Make ospf vty socket. */
|
/* Make ospf vty socket. */
|
||||||
vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH);
|
vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
/* Print start message */
|
/* Print start message */
|
||||||
zlog_notice ("OSPF6d (Zebra-%s ospf6d-%s) starts",
|
zlog_notice ("OSPF6d (Zebra-%s ospf6d-%s) starts",
|
||||||
ZEBRA_VERSION, OSPF6_DAEMON_VERSION);
|
ZEBRA_VERSION, OSPF6_DAEMON_VERSION);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Start finite state machine, here we go! */
|
/* Start finite state machine, here we go! */
|
||||||
while (thread_fetch (master, &thread))
|
while (thread_fetch (master, &thread))
|
||||||
|
|
|
@ -255,10 +255,8 @@ ospf6_leave_allspfrouters (u_int ifindex)
|
||||||
&mreq6, sizeof (mreq6)) < 0)
|
&mreq6, sizeof (mreq6)) < 0)
|
||||||
zlog_warn ("Network: Leave AllSPFRouters on ifindex %d Failed: %s",
|
zlog_warn ("Network: Leave AllSPFRouters on ifindex %d Failed: %s",
|
||||||
ifindex, strerror (errno));
|
ifindex, strerror (errno));
|
||||||
#if 0
|
|
||||||
else
|
else
|
||||||
zlog_info ("Network: Leave AllSPFRouters on ifindex %d", ifindex);
|
zlog_info ("Network: Leave AllSPFRouters on ifindex %d", ifindex);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -275,10 +273,8 @@ ospf6_join_alldrouters (u_int ifindex)
|
||||||
&mreq6, sizeof (mreq6)) < 0)
|
&mreq6, sizeof (mreq6)) < 0)
|
||||||
zlog_warn ("Network: Join AllDRouters on ifindex %d Failed: %s",
|
zlog_warn ("Network: Join AllDRouters on ifindex %d Failed: %s",
|
||||||
ifindex, strerror (errno));
|
ifindex, strerror (errno));
|
||||||
#if 0
|
|
||||||
else
|
else
|
||||||
zlog_info ("Network: Join AllDRouters on ifindex %d", ifindex);
|
zlog_info ("Network: Join AllDRouters on ifindex %d", ifindex);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -294,10 +290,8 @@ ospf6_leave_alldrouters (u_int ifindex)
|
||||||
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
|
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
|
||||||
&mreq6, sizeof (mreq6)) < 0)
|
&mreq6, sizeof (mreq6)) < 0)
|
||||||
zlog_warn ("Network: Leave AllDRouters on ifindex %d Failed", ifindex);
|
zlog_warn ("Network: Leave AllDRouters on ifindex %d Failed", ifindex);
|
||||||
#if 0
|
|
||||||
else
|
else
|
||||||
zlog_info ("Network: Leave AllDRouters on ifindex %d", ifindex);
|
zlog_info ("Network: Leave AllDRouters on ifindex %d", ifindex);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setsockopt ReUseAddr to on */
|
/* setsockopt ReUseAddr to on */
|
||||||
|
@ -340,7 +334,7 @@ void
|
||||||
ospf6_set_checksum ()
|
ospf6_set_checksum ()
|
||||||
{
|
{
|
||||||
int offset = 12;
|
int offset = 12;
|
||||||
#ifndef DISABLE_IPV6_CHECKSUM
|
#if !defined(DISABLE_IPV6_CHECKSUM)
|
||||||
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_CHECKSUM,
|
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_CHECKSUM,
|
||||||
&offset, sizeof (offset)) < 0)
|
&offset, sizeof (offset)) < 0)
|
||||||
zlog_warn ("Network: set IPV6_CHECKSUM failed: %s", strerror (errno));
|
zlog_warn ("Network: set IPV6_CHECKSUM failed: %s", strerror (errno));
|
||||||
|
|
|
@ -286,6 +286,9 @@ ospf6_create (unsigned long process_id)
|
||||||
void
|
void
|
||||||
ospf6_delete (struct ospf6 *ospf6)
|
ospf6_delete (struct ospf6 *ospf6)
|
||||||
{
|
{
|
||||||
|
if (!ospf6)
|
||||||
|
return;
|
||||||
|
|
||||||
ospf6_route_remove_all (ospf6->route_table);
|
ospf6_route_remove_all (ospf6->route_table);
|
||||||
ospf6_free (ospf6);
|
ospf6_free (ospf6);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue