+++ /dev/null
---- a/ospfd/ospf_lsa.h
-+++ b/ospfd/ospf_lsa.h
-@@ -114,6 +114,9 @@ struct ospf_lsa
-
- /* Refreshement List or Queue */
- int refresh_list;
-+
-+ /* For Type-9 Opaque-LSAs */
-+ struct ospf_interface *oi;
- };
-
- /* OSPF LSA Link Type. */
---- a/ospfd/ospf_nsm.c
-+++ b/ospfd/ospf_nsm.c
-@@ -216,7 +216,7 @@ ospf_db_summary_add (struct ospf_neighbo
- {
- case OSPF_OPAQUE_LINK_LSA:
- /* Exclude type-9 LSAs that does not have the same "oi" with "nbr". */
-- if (lsa->oi != nbr->oi)
-+ if (nbr->oi && ospf_if_exists (lsa->oi) != nbr->oi)
- return 0;
- break;
- case OSPF_OPAQUE_AREA_LSA:
---- a/ospfd/ospf_opaque.c
-+++ b/ospfd/ospf_opaque.c
-@@ -251,7 +251,7 @@ struct ospf_opaque_functab
- void (* config_write_debug )(struct vty *vty);
- void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa);
- int (* lsa_originator)(void *arg);
-- void (* lsa_refresher )(struct ospf_lsa *lsa);
-+ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa);
- int (* new_lsa_hook)(struct ospf_lsa *lsa);
- int (* del_lsa_hook)(struct ospf_lsa *lsa);
- };
-@@ -354,7 +354,7 @@ ospf_register_opaque_functab (
- void (* config_write_debug )(struct vty *vty),
- void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa),
- int (* lsa_originator)(void *arg),
-- void (* lsa_refresher )(struct ospf_lsa *lsa),
-+ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
- int (* new_lsa_hook)(struct ospf_lsa *lsa),
- int (* del_lsa_hook)(struct ospf_lsa *lsa))
- {
-@@ -1608,12 +1608,13 @@ out:
- return new;
- }
-
--void
-+struct ospf_lsa *
- ospf_opaque_lsa_refresh (struct ospf_lsa *lsa)
- {
- struct ospf *ospf;
- struct ospf_opaque_functab *functab;
--
-+ struct ospf_lsa *new = NULL;
-+
- ospf = ospf_lookup ();
-
- if ((functab = ospf_opaque_functab_lookup (lsa)) == NULL
-@@ -1633,9 +1634,9 @@ ospf_opaque_lsa_refresh (struct ospf_lsa
- ospf_lsa_flush (ospf, lsa);
- }
- else
-- (* functab->lsa_refresher)(lsa);
-+ new = (* functab->lsa_refresher)(lsa);
-
-- return;
-+ return new;
- }
-
- /*------------------------------------------------------------------------*
---- a/ospfd/ospf_opaque.h
-+++ b/ospfd/ospf_opaque.h
-@@ -120,7 +120,7 @@ ospf_register_opaque_functab (
- void (* config_write_debug )(struct vty *vty),
- void (* show_opaque_info )(struct vty *vty, struct ospf_lsa *lsa),
- int (* lsa_originator)(void *arg),
-- void (* lsa_refresher )(struct ospf_lsa *lsa),
-+ struct ospf_lsa *(* lsa_refresher )(struct ospf_lsa *lsa),
- int (* new_lsa_hook)(struct ospf_lsa *lsa),
- int (* del_lsa_hook)(struct ospf_lsa *lsa)
- );
-@@ -143,7 +143,7 @@ extern void ospf_opaque_lsa_originate_sc
- int *init_delay);
- extern struct ospf_lsa *ospf_opaque_lsa_install (struct ospf_lsa *,
- int rt_recalc);
--extern void ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
-+extern struct ospf_lsa *ospf_opaque_lsa_refresh (struct ospf_lsa *lsa);
-
- extern void ospf_opaque_lsa_reoriginate_schedule (void *lsa_type_dependent,
- u_char lsa_type,
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
-@@ -8228,8 +8228,14 @@ bgp_str2route_type (int afi, const char
+@@ -8399,8 +8399,14 @@ bgp_str2route_type (int afi, const char
return ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
return ZEBRA_ROUTE_RIP;
}
if (afi == AFI_IP6)
{
-@@ -8241,21 +8247,30 @@ bgp_str2route_type (int afi, const char
+@@ -8412,21 +8418,30 @@ bgp_str2route_type (int afi, const char
return ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
return ZEBRA_ROUTE_RIPNG;
{
int type;
-@@ -8270,13 +8285,16 @@ DEFUN (bgp_redistribute_ipv4,
+@@ -8441,13 +8456,16 @@ DEFUN (bgp_redistribute_ipv4,
DEFUN (bgp_redistribute_ipv4_rmap,
bgp_redistribute_ipv4_rmap_cmd,
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -8295,13 +8313,16 @@ DEFUN (bgp_redistribute_ipv4_rmap,
+@@ -8466,13 +8484,16 @@ DEFUN (bgp_redistribute_ipv4_rmap,
DEFUN (bgp_redistribute_ipv4_metric,
bgp_redistribute_ipv4_metric_cmd,
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8322,13 +8343,16 @@ DEFUN (bgp_redistribute_ipv4_metric,
+@@ -8493,13 +8514,16 @@ DEFUN (bgp_redistribute_ipv4_metric,
DEFUN (bgp_redistribute_ipv4_rmap_metric,
bgp_redistribute_ipv4_rmap_metric_cmd,
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8352,13 +8376,16 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
+@@ -8523,13 +8547,16 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
DEFUN (bgp_redistribute_ipv4_metric_rmap,
bgp_redistribute_ipv4_metric_rmap_cmd,
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -8382,14 +8409,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
+@@ -8553,14 +8580,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
DEFUN (no_bgp_redistribute_ipv4,
no_bgp_redistribute_ipv4_cmd,
{
int type;
-@@ -8405,7 +8435,7 @@ DEFUN (no_bgp_redistribute_ipv4,
+@@ -8576,7 +8606,7 @@ DEFUN (no_bgp_redistribute_ipv4,
DEFUN (no_bgp_redistribute_ipv4_rmap,
no_bgp_redistribute_ipv4_rmap_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8413,6 +8443,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
+@@ -8584,6 +8614,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -8431,7 +8464,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
+@@ -8602,7 +8635,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
DEFUN (no_bgp_redistribute_ipv4_metric,
no_bgp_redistribute_ipv4_metric_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8439,6 +8472,9 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
+@@ -8610,6 +8643,9 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8457,7 +8493,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
+@@ -8628,7 +8664,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
no_bgp_redistribute_ipv4_rmap_metric_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8465,6 +8501,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
+@@ -8636,6 +8672,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8486,7 +8525,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
+@@ -8657,7 +8696,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
no_bgp_redistribute_ipv4_metric_rmap_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8494,6 +8533,9 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
+@@ -8665,6 +8704,9 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -8502,13 +8544,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
+@@ -8673,13 +8715,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
#ifdef HAVE_IPV6
DEFUN (bgp_redistribute_ipv6,
bgp_redistribute_ipv6_cmd,
{
int type;
-@@ -8524,13 +8569,16 @@ DEFUN (bgp_redistribute_ipv6,
+@@ -8695,13 +8740,16 @@ DEFUN (bgp_redistribute_ipv6,
DEFUN (bgp_redistribute_ipv6_rmap,
bgp_redistribute_ipv6_rmap_cmd,
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -8549,13 +8597,16 @@ DEFUN (bgp_redistribute_ipv6_rmap,
+@@ -8720,13 +8768,16 @@ DEFUN (bgp_redistribute_ipv6_rmap,
DEFUN (bgp_redistribute_ipv6_metric,
bgp_redistribute_ipv6_metric_cmd,
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8576,13 +8627,16 @@ DEFUN (bgp_redistribute_ipv6_metric,
+@@ -8747,13 +8798,16 @@ DEFUN (bgp_redistribute_ipv6_metric,
DEFUN (bgp_redistribute_ipv6_rmap_metric,
bgp_redistribute_ipv6_rmap_metric_cmd,
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8606,13 +8660,16 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
+@@ -8777,13 +8831,16 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
DEFUN (bgp_redistribute_ipv6_metric_rmap,
bgp_redistribute_ipv6_metric_rmap_cmd,
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -8636,14 +8693,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
+@@ -8807,14 +8864,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
DEFUN (no_bgp_redistribute_ipv6,
no_bgp_redistribute_ipv6_cmd,
{
int type;
-@@ -8659,7 +8719,7 @@ DEFUN (no_bgp_redistribute_ipv6,
+@@ -8830,7 +8890,7 @@ DEFUN (no_bgp_redistribute_ipv6,
DEFUN (no_bgp_redistribute_ipv6_rmap,
no_bgp_redistribute_ipv6_rmap_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8667,6 +8727,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
+@@ -8838,6 +8898,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -8685,7 +8748,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
+@@ -8856,7 +8919,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
DEFUN (no_bgp_redistribute_ipv6_metric,
no_bgp_redistribute_ipv6_metric_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8693,6 +8756,9 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
+@@ -8864,6 +8927,9 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8711,7 +8777,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
+@@ -8882,7 +8948,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
no_bgp_redistribute_ipv6_rmap_metric_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8719,6 +8785,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
+@@ -8890,6 +8956,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8740,7 +8809,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
+@@ -8911,7 +8980,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
no_bgp_redistribute_ipv6_metric_rmap_cmd,
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8748,6 +8817,9 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
+@@ -8919,6 +8988,9 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
"Route map reference\n"
--- a/lib/log.c
+++ b/lib/log.c
-@@ -838,6 +838,8 @@ static const struct zebra_desc_table rou
+@@ -837,6 +837,8 @@ static const struct zebra_desc_table rou
DESC_ENTRY (ZEBRA_ROUTE_ISIS, "isis", 'I' ),
DESC_ENTRY (ZEBRA_ROUTE_BGP, "bgp", 'B' ),
DESC_ENTRY (ZEBRA_ROUTE_HSLS, "hsls", 'H' ),
+ZEBRA_ROUTE_BATMAN, "Better Approach to Mobile Ad-Hoc Networking (BATMAN)"
--- a/lib/zebra.h
+++ b/lib/zebra.h
-@@ -441,7 +441,9 @@ struct in_pktinfo
+@@ -437,7 +437,9 @@ struct in_pktinfo
#define ZEBRA_ROUTE_ISIS 8
#define ZEBRA_ROUTE_BGP 9
#define ZEBRA_ROUTE_HSLS 10
};
\f
/* Vector for routing table. */
-@@ -1229,6 +1232,8 @@ static const u_char meta_queue_map[ZEBRA
+@@ -374,6 +377,18 @@ nexthop_active_ipv4 (struct rib *rib, st
+
+ return 1;
+ }
++ else if (match->type == ZEBRA_ROUTE_OLSR)
++ {
++ for (newhop = match->nexthop; newhop; newhop = newhop->next)
++ if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB)
++ && newhop->type == NEXTHOP_TYPE_IFINDEX)
++ {
++ if (nexthop->type == NEXTHOP_TYPE_IPV4)
++ nexthop->ifindex = newhop->ifindex;
++ return 1;
++ }
++ return 0;
++ }
+ else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL))
+ {
+ for (newhop = match->nexthop; newhop; newhop = newhop->next)
+@@ -476,6 +491,18 @@ nexthop_active_ipv6 (struct rib *rib, st
+
+ return 1;
+ }
++ else if (match->type == ZEBRA_ROUTE_OLSR)
++ {
++ for (newhop = match->nexthop; newhop; newhop = newhop->next)
++ if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB)
++ && newhop->type == NEXTHOP_TYPE_IFINDEX)
++ {
++ if (nexthop->type == NEXTHOP_TYPE_IPV6)
++ nexthop->ifindex = newhop->ifindex;
++ return 1;
++ }
++ return 0;
++ }
+ else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL))
+ {
+ for (newhop = match->nexthop; newhop; newhop = newhop->next)
+@@ -1229,6 +1256,8 @@ static const u_char meta_queue_map[ZEBRA
[ZEBRA_ROUTE_ISIS] = 2,
[ZEBRA_ROUTE_BGP] = 3,
[ZEBRA_ROUTE_HSLS] = 4,
else
{
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
+--- a/zebra/rt_netlink.c
++++ b/zebra/rt_netlink.c
+@@ -1494,6 +1494,9 @@ netlink_route_multipath (int cmd, struct
+ addattr_l (&req.n, sizeof req, RTA_PREFSRC,
+ &nexthop->src.ipv4, bytelen);
+
++ if (rib->type == ZEBRA_ROUTE_OLSR)
++ req.r.rtm_scope = RT_SCOPE_LINK;
++
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug("netlink_route_multipath() (single hop): "
+ "nexthop via if %u", nexthop->ifindex);
/* Header of detailed BGP route information */
static void
route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
-@@ -11063,6 +11108,64 @@ DEFUN (bgp_damp_set,
+@@ -11823,6 +11868,64 @@ DEFUN (bgp_damp_set,
half, reuse, suppress, max);
}
ALIAS (bgp_damp_set,
bgp_damp_set2_cmd,
"bgp dampening <1-45>",
-@@ -11112,6 +11215,19 @@ DEFUN (show_ip_bgp_dampened_paths,
+@@ -11872,6 +11975,19 @@ DEFUN (show_ip_bgp_dampened_paths,
NULL);
}
DEFUN (show_ip_bgp_flap_statistics,
show_ip_bgp_flap_statistics_cmd,
"show ip bgp flap-statistics",
-@@ -11629,6 +11745,7 @@ bgp_route_init (void)
+@@ -12398,6 +12514,7 @@ bgp_route_init (void)
install_element (VIEW_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd);
install_element (VIEW_NODE, &show_ip_bgp_dampened_paths_cmd);
install_element (VIEW_NODE, &show_ip_bgp_flap_statistics_cmd);
install_element (VIEW_NODE, &show_ip_bgp_flap_address_cmd);
install_element (VIEW_NODE, &show_ip_bgp_flap_prefix_cmd);
-@@ -11736,6 +11853,7 @@ bgp_route_init (void)
+@@ -12531,6 +12648,7 @@ bgp_route_init (void)
install_element (ENABLE_NODE, &show_ip_bgp_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbor_received_prefix_filter_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_dampened_paths_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_flap_statistics_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_flap_address_cmd);
install_element (ENABLE_NODE, &show_ip_bgp_flap_prefix_cmd);
-@@ -12093,6 +12211,10 @@ bgp_route_init (void)
+@@ -12918,6 +13036,10 @@ bgp_route_init (void)
install_element (BGP_IPV4_NODE, &bgp_damp_unset_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_unset2_cmd);
--- a/lib/memtypes.c
+++ b/lib/memtypes.c
-@@ -149,6 +149,15 @@ struct memory_list memory_list_bgp[] =
+@@ -147,6 +147,15 @@ struct memory_list memory_list_bgp[] =
{ MTYPE_PEER_UPDATE_SOURCE, "BGP peer update interface" },
{ MTYPE_BGP_DAMP_INFO, "Dampening info" },
{ MTYPE_BGP_DAMP_ARRAY, "BGP Dampening array" },