From cb4b88452e04a0102fedff4f01a2246f5e70dea9 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Mon, 15 May 2006 10:39:30 +0000 Subject: [ospf6d] Import GNU Zebra CVSps#3559: Fix inter-area as-ext bug, cleanup debug 2005-10-06 Yasuhiro Ohara * ospf6_asbr.c: fix bug of calculating AS-External routes in other areas. Add debugging function for border-router calculation. * ospf6d.h: version 0.9.7p --- ospf6d/ospf6_asbr.c | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'ospf6d/ospf6_asbr.c') diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 286b5c1b..7980a643 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -294,45 +294,43 @@ ospf6_asbr_lsa_remove (struct ospf6_lsa *lsa) void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry) { - char buf[64]; struct ospf6_lsa *lsa; u_int16_t type; u_int32_t router; - if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL)) + if (! CHECK_FLAG (asbr_entry->flag, OSPF6_ROUTE_BEST)) { - ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf)); - zlog_debug ("New ASBR %s found", buf); + char buf[16]; + inet_ntop (AF_INET, &ADV_ROUTER_IN_PREFIX (&asbr_entry->prefix), + buf, sizeof (buf)); + zlog_info ("ignore non-best path: lsentry %s add", buf); + return; } type = htons (OSPF6_LSTYPE_AS_EXTERNAL); router = ospf6_linkstate_prefix_adv_router (&asbr_entry->prefix); - for (lsa = ospf6_lsdb_type_router_head (type, router, ospf6->lsdb); - lsa; lsa = ospf6_lsdb_type_router_next (type, router, lsa)) + for (lsa = ospf6_lsdb_type_router_head (type, router, ospf6->lsdb); lsa; + lsa = ospf6_lsdb_type_router_next (type, router, lsa)) { if (! OSPF6_LSA_IS_MAXAGE (lsa)) ospf6_asbr_lsa_add (lsa); } - - if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL)) - { - ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf)); - zlog_debug ("Calculation for new ASBR %s done", buf); - } } void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry) { - char buf[64]; struct ospf6_lsa *lsa; u_int16_t type; u_int32_t router; - if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL)) + if (! CHECK_FLAG (asbr_entry->flag, OSPF6_ROUTE_BEST)) { - ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf)); - zlog_debug ("ASBR %s disappeared", buf); + char buf[16]; + inet_ntop (AF_INET, &ADV_ROUTER_IN_PREFIX (&asbr_entry->prefix), + buf, sizeof (buf)); + zlog_info ("ignore non-best path: lsentry %s remove", buf); + return; } type = htons (OSPF6_LSTYPE_AS_EXTERNAL); @@ -340,12 +338,6 @@ ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry) for (lsa = ospf6_lsdb_type_router_head (type, router, ospf6->lsdb); lsa; lsa = ospf6_lsdb_type_router_next (type, router, lsa)) ospf6_asbr_lsa_remove (lsa); - - if (IS_OSPF6_DEBUG_EXAMIN (AS_EXTERNAL)) - { - ospf6_linkstate_prefix2str (&asbr_entry->prefix, buf, sizeof (buf)); - zlog_debug ("Calculation for old ASBR %s done", buf); - } } -- cgit v1.2.3 From 0b26f81bf9e81be0f65787c48061709427c70d10 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Mon, 15 May 2006 10:47:53 +0000 Subject: [ospf6d] GNU Zebra 3563: Fix as-external forwarding address 2006-03-01 Yasuhiro Ohara * ospf6_asbr.c: fix bug of needless forwarding address * ospf6d.h: version 0.9.7r --- ospf6d/ospf6_asbr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ospf6d/ospf6_asbr.c') diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 7980a643..1b6ccbd9 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -59,6 +59,7 @@ ospf6_as_external_lsa_originate (struct ospf6_route *route) char buffer[OSPF6_MAX_LSASIZE]; struct ospf6_lsa_header *lsa_header; struct ospf6_lsa *old, *lsa; + struct ospf6_external_info *info = route->route_option; struct ospf6_as_external_lsa *as_external_lsa; char buf[64]; @@ -91,7 +92,7 @@ ospf6_as_external_lsa_originate (struct ospf6_route *route) UNSET_FLAG (as_external_lsa->bits_metric, OSPF6_ASBR_BIT_E); /* forwarding address */ - if (! IN6_IS_ADDR_UNSPECIFIED (&route->nexthop[0].address)) + if (! IN6_IS_ADDR_UNSPECIFIED (&info->forwarding)) SET_FLAG (as_external_lsa->bits_metric, OSPF6_ASBR_BIT_F); else UNSET_FLAG (as_external_lsa->bits_metric, OSPF6_ASBR_BIT_F); @@ -120,7 +121,7 @@ ospf6_as_external_lsa_originate (struct ospf6_route *route) /* Forwarding address */ if (CHECK_FLAG (as_external_lsa->bits_metric, OSPF6_ASBR_BIT_F)) { - memcpy (p, &route->nexthop[0].address, sizeof (struct in6_addr)); + memcpy (p, &info->forwarding, sizeof (struct in6_addr)); p += sizeof (struct in6_addr); } -- cgit v1.2.3 From fbdbf1281660de877ef687a82145e82934f35744 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Mon, 22 Oct 2007 18:34:41 +0000 Subject: [ospf6d] Fix removal of defunct ASBR routes 2007-10-22 Phil Spagnolo * ospf6_asbr.c: (ospf6_asbr_lsentry_remove) Remove shortcut of LSDB search - it's based on assumption non-BEST routes can't have ASBR routes, which appears to be wrong. Safest to search. --- ospf6d/ospf6_asbr.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'ospf6d/ospf6_asbr.c') diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 1b6ccbd9..c12eecae 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -325,15 +325,6 @@ ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry) u_int16_t type; u_int32_t router; - if (! CHECK_FLAG (asbr_entry->flag, OSPF6_ROUTE_BEST)) - { - char buf[16]; - inet_ntop (AF_INET, &ADV_ROUTER_IN_PREFIX (&asbr_entry->prefix), - buf, sizeof (buf)); - zlog_info ("ignore non-best path: lsentry %s remove", buf); - return; - } - type = htons (OSPF6_LSTYPE_AS_EXTERNAL); router = ospf6_linkstate_prefix_adv_router (&asbr_entry->prefix); for (lsa = ospf6_lsdb_type_router_head (type, router, ospf6->lsdb); -- cgit v1.2.3 From 6ac29a51075def99217a4ab1015635db3b3e83ed Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 15 Aug 2008 13:45:30 +0100 Subject: [trivia] finish off static'ification of ospf6d and ripngd 2008-08-15 Paul Jakma * {ospf6d,ripngd}/*: Finish job of marking functions as static, or exporting declarations for them, to quell warning noise with Quagga's GCC default high-level of warning flags. Thus allowing remaining, more useful warnings to be more easily seen. --- ospf6d/ospf6_asbr.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'ospf6d/ospf6_asbr.c') diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index c12eecae..37b912b4 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -53,7 +53,7 @@ unsigned char conf_debug_ospf6_asbr = 0; #define ZROUTE_NAME(x) zebra_route_string(x) /* AS External LSA origination */ -void +static void ospf6_as_external_lsa_originate (struct ospf6_route *route) { char buffer[OSPF6_MAX_LSASIZE]; @@ -336,7 +336,7 @@ ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry) /* redistribute function */ -void +static void ospf6_asbr_routemap_set (int type, const char *mapname) { if (ospf6->rmap[type].name) @@ -345,7 +345,7 @@ ospf6_asbr_routemap_set (int type, const char *mapname) ospf6->rmap[type].map = route_map_lookup_by_name (mapname); } -void +static void ospf6_asbr_routemap_unset (int type) { if (ospf6->rmap[type].name) @@ -354,7 +354,7 @@ ospf6_asbr_routemap_unset (int type) ospf6->rmap[type].map = NULL; } -void +static void ospf6_asbr_routemap_update (const char *mapname) { int type; @@ -378,13 +378,13 @@ ospf6_asbr_is_asbr (struct ospf6 *o) return o->external_table->count; } -void +static void ospf6_asbr_redistribute_set (int type) { ospf6_zebra_redistribute (type); } -void +static void ospf6_asbr_redistribute_unset (int type) { struct ospf6_route *route; @@ -731,7 +731,7 @@ ospf6_redistribute_config_write (struct vty *vty) return 0; } -void +static void ospf6_redistribute_show_config (struct vty *vty) { int type; @@ -774,7 +774,7 @@ ospf6_redistribute_show_config (struct vty *vty) /* Routemap Functions */ -route_map_result_t +static route_map_result_t ospf6_routemap_rule_match_address_prefixlist (void *rule, struct prefix *prefix, route_map_object_t type, @@ -793,13 +793,13 @@ ospf6_routemap_rule_match_address_prefixlist (void *rule, RMAP_NOMATCH : RMAP_MATCH); } -void * +static void * ospf6_routemap_rule_match_address_prefixlist_compile (const char *arg) { return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_match_address_prefixlist_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -814,7 +814,7 @@ ospf6_routemap_rule_match_address_prefixlist_cmd = ospf6_routemap_rule_match_address_prefixlist_free, }; -route_map_result_t +static route_map_result_t ospf6_routemap_rule_set_metric_type (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -832,7 +832,7 @@ ospf6_routemap_rule_set_metric_type (void *rule, struct prefix *prefix, return RMAP_OKAY; } -void * +static void * ospf6_routemap_rule_set_metric_type_compile (const char *arg) { if (strcmp (arg, "type-2") && strcmp (arg, "type-1")) @@ -840,7 +840,7 @@ ospf6_routemap_rule_set_metric_type_compile (const char *arg) return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_set_metric_type_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -855,7 +855,7 @@ ospf6_routemap_rule_set_metric_type_cmd = ospf6_routemap_rule_set_metric_type_free, }; -route_map_result_t +static route_map_result_t ospf6_routemap_rule_set_metric (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -869,7 +869,7 @@ ospf6_routemap_rule_set_metric (void *rule, struct prefix *prefix, return RMAP_OKAY; } -void * +static void * ospf6_routemap_rule_set_metric_compile (const char *arg) { u_int32_t metric; @@ -880,7 +880,7 @@ ospf6_routemap_rule_set_metric_compile (const char *arg) return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_set_metric_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -895,7 +895,7 @@ ospf6_routemap_rule_set_metric_cmd = ospf6_routemap_rule_set_metric_free, }; -route_map_result_t +static route_map_result_t ospf6_routemap_rule_set_forwarding (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -915,7 +915,7 @@ ospf6_routemap_rule_set_forwarding (void *rule, struct prefix *prefix, return RMAP_OKAY; } -void * +static void * ospf6_routemap_rule_set_forwarding_compile (const char *arg) { struct in6_addr a; @@ -924,7 +924,7 @@ ospf6_routemap_rule_set_forwarding_compile (const char *arg) return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_set_forwarding_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -939,7 +939,7 @@ ospf6_routemap_rule_set_forwarding_cmd = ospf6_routemap_rule_set_forwarding_free, }; -int +static int route_map_command_status (struct vty *vty, int ret) { if (! ret) @@ -1074,8 +1074,8 @@ DEFUN (ospf6_routemap_no_set_forwarding, return route_map_command_status (vty, ret); } -void -ospf6_routemap_init () +static void +ospf6_routemap_init (void) { route_map_init (); route_map_init_vty (); @@ -1106,7 +1106,7 @@ ospf6_routemap_init () /* Display functions */ -int +static int ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { struct ospf6_as_external_lsa *external; @@ -1154,7 +1154,7 @@ ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) return 0; } -void +static void ospf6_asbr_external_route_show (struct vty *vty, struct ospf6_route *route) { struct ospf6_external_info *info = route->route_option; @@ -1206,7 +1206,7 @@ struct ospf6_lsa_handler as_external_handler = }; void -ospf6_asbr_init () +ospf6_asbr_init (void) { ospf6_routemap_init (); -- cgit v1.2.3