mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 15:33:56 +00:00
Merge pull request #12413 from donaldsharp/misc_and_then_some
Misc and then some
This commit is contained in:
commit
a70449c214
@ -278,8 +278,10 @@ void bgp_mp_list_add(struct list *mp_list, struct bgp_path_info *mpinfo)
|
|||||||
static struct bgp_path_info_mpath *bgp_path_info_mpath_new(void)
|
static struct bgp_path_info_mpath *bgp_path_info_mpath_new(void)
|
||||||
{
|
{
|
||||||
struct bgp_path_info_mpath *new_mpath;
|
struct bgp_path_info_mpath *new_mpath;
|
||||||
|
|
||||||
new_mpath = XCALLOC(MTYPE_BGP_MPATH_INFO,
|
new_mpath = XCALLOC(MTYPE_BGP_MPATH_INFO,
|
||||||
sizeof(struct bgp_path_info_mpath));
|
sizeof(struct bgp_path_info_mpath));
|
||||||
|
|
||||||
return new_mpath;
|
return new_mpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,8 +315,6 @@ bgp_path_info_mpath_get(struct bgp_path_info *path)
|
|||||||
|
|
||||||
if (!path->mpath) {
|
if (!path->mpath) {
|
||||||
mpath = bgp_path_info_mpath_new();
|
mpath = bgp_path_info_mpath_new();
|
||||||
if (!mpath)
|
|
||||||
return NULL;
|
|
||||||
path->mpath = mpath;
|
path->mpath = mpath;
|
||||||
mpath->mp_info = path;
|
mpath->mp_info = path;
|
||||||
}
|
}
|
||||||
|
@ -1322,7 +1322,7 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
|
|||||||
ospf6_copy_nexthops(tmp_route->nh_list,
|
ospf6_copy_nexthops(tmp_route->nh_list,
|
||||||
o_path->nh_list);
|
o_path->nh_list);
|
||||||
|
|
||||||
if (ospf6_route_cmp_nexthops(tmp_route, route) != 0) {
|
if (!ospf6_route_cmp_nexthops(tmp_route, route)) {
|
||||||
/* adv. router exists in the list, update nhs */
|
/* adv. router exists in the list, update nhs */
|
||||||
list_delete_all_node(o_path->nh_list);
|
list_delete_all_node(o_path->nh_list);
|
||||||
ospf6_copy_nexthops(o_path->nh_list,
|
ospf6_copy_nexthops(o_path->nh_list,
|
||||||
|
@ -246,7 +246,10 @@ void ospf6_merge_nexthops(struct list *dst, struct list *src)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ospf6_route_cmp_nexthops(struct ospf6_route *a, struct ospf6_route *b)
|
/*
|
||||||
|
* If the nexthops are the same return true
|
||||||
|
*/
|
||||||
|
bool ospf6_route_cmp_nexthops(struct ospf6_route *a, struct ospf6_route *b)
|
||||||
{
|
{
|
||||||
struct listnode *anode, *bnode;
|
struct listnode *anode, *bnode;
|
||||||
struct ospf6_nexthop *anh, *bnh;
|
struct ospf6_nexthop *anh, *bnh;
|
||||||
@ -264,14 +267,14 @@ int ospf6_route_cmp_nexthops(struct ospf6_route *a, struct ospf6_route *b)
|
|||||||
/* Currnet List A element not found List B
|
/* Currnet List A element not found List B
|
||||||
* Non-Identical lists return */
|
* Non-Identical lists return */
|
||||||
if (identical == false)
|
if (identical == false)
|
||||||
return 1;
|
return false;
|
||||||
}
|
}
|
||||||
return 0;
|
return true;
|
||||||
} else
|
} else
|
||||||
return 1;
|
return false;
|
||||||
}
|
}
|
||||||
/* One of the routes doesn't exist ? */
|
/* One of the routes doesn't exist ? */
|
||||||
return (1);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ospf6_num_nexthops(struct list *nh_list)
|
int ospf6_num_nexthops(struct list *nh_list)
|
||||||
@ -577,12 +580,7 @@ ospf6_route_lookup_identical(struct ospf6_route *route,
|
|||||||
|
|
||||||
for (target = ospf6_route_lookup(&route->prefix, table); target;
|
for (target = ospf6_route_lookup(&route->prefix, table); target;
|
||||||
target = target->next) {
|
target = target->next) {
|
||||||
if (target->type == route->type
|
if (ospf6_route_is_identical(target, route))
|
||||||
&& prefix_same(&target->prefix, &route->prefix)
|
|
||||||
&& target->path.type == route->path.type
|
|
||||||
&& target->path.cost == route->path.cost
|
|
||||||
&& target->path.u.cost_e2 == route->path.u.cost_e2
|
|
||||||
&& ospf6_route_cmp_nexthops(target, route) == 0)
|
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -304,7 +304,7 @@ extern const char *const ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
|
|||||||
(ra)->path.cost == (rb)->path.cost && \
|
(ra)->path.cost == (rb)->path.cost && \
|
||||||
(ra)->path.u.cost_e2 == (rb)->path.u.cost_e2 && \
|
(ra)->path.u.cost_e2 == (rb)->path.u.cost_e2 && \
|
||||||
listcount(ra->paths) == listcount(rb->paths) && \
|
listcount(ra->paths) == listcount(rb->paths) && \
|
||||||
ospf6_route_cmp_nexthops(ra, rb) == 0)
|
ospf6_route_cmp_nexthops(ra, rb))
|
||||||
|
|
||||||
#define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))
|
#define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))
|
||||||
|
|
||||||
@ -330,8 +330,8 @@ extern void ospf6_add_nexthop(struct list *nh_list, int ifindex,
|
|||||||
struct in6_addr *addr);
|
struct in6_addr *addr);
|
||||||
extern void ospf6_add_route_nexthop_blackhole(struct ospf6_route *route);
|
extern void ospf6_add_route_nexthop_blackhole(struct ospf6_route *route);
|
||||||
extern int ospf6_num_nexthops(struct list *nh_list);
|
extern int ospf6_num_nexthops(struct list *nh_list);
|
||||||
extern int ospf6_route_cmp_nexthops(struct ospf6_route *a,
|
extern bool ospf6_route_cmp_nexthops(struct ospf6_route *a,
|
||||||
struct ospf6_route *b);
|
struct ospf6_route *b);
|
||||||
extern void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route,
|
extern void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route,
|
||||||
struct zapi_nexthop nexthops[],
|
struct zapi_nexthop nexthops[],
|
||||||
int entries, vrf_id_t vrf_id);
|
int entries, vrf_id_t vrf_id);
|
||||||
|
@ -223,8 +223,10 @@ int ospf_dr_election(struct ospf_interface *oi)
|
|||||||
|
|
||||||
new_state = ospf_ism_state(oi);
|
new_state = ospf_ism_state(oi);
|
||||||
|
|
||||||
zlog_debug("DR-Election[1st]: Backup %pI4", &BDR(oi));
|
if (IS_DEBUG_OSPF(ism, ISM_STATUS)) {
|
||||||
zlog_debug("DR-Election[1st]: DR %pI4", &DR(oi));
|
zlog_debug("DR-Election[1st]: Backup %pI4", &BDR(oi));
|
||||||
|
zlog_debug("DR-Election[1st]: DR %pI4", &DR(oi));
|
||||||
|
}
|
||||||
|
|
||||||
if (new_state != old_state
|
if (new_state != old_state
|
||||||
&& !(new_state == ISM_DROther && old_state < ISM_DROther)) {
|
&& !(new_state == ISM_DROther && old_state < ISM_DROther)) {
|
||||||
@ -233,8 +235,10 @@ int ospf_dr_election(struct ospf_interface *oi)
|
|||||||
|
|
||||||
new_state = ospf_ism_state(oi);
|
new_state = ospf_ism_state(oi);
|
||||||
|
|
||||||
zlog_debug("DR-Election[2nd]: Backup %pI4", &BDR(oi));
|
if (IS_DEBUG_OSPF(ism, ISM_STATUS)) {
|
||||||
zlog_debug("DR-Election[2nd]: DR %pI4", &DR(oi));
|
zlog_debug("DR-Election[2nd]: Backup %pI4", &BDR(oi));
|
||||||
|
zlog_debug("DR-Election[2nd]: DR %pI4", &DR(oi));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list_delete(&el_list);
|
list_delete(&el_list);
|
||||||
|
@ -104,11 +104,12 @@ int ospf_if_add_alldrouters(struct ospf *top, struct prefix *p,
|
|||||||
"can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %pI4, ifindex %u, AllDRouters): %s; perhaps a kernel limit on # of multicast group memberships has been exceeded?",
|
"can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %pI4, ifindex %u, AllDRouters): %s; perhaps a kernel limit on # of multicast group memberships has been exceeded?",
|
||||||
top->fd, &p->u.prefix4, ifindex,
|
top->fd, &p->u.prefix4, ifindex,
|
||||||
safe_strerror(errno));
|
safe_strerror(errno));
|
||||||
else
|
else {
|
||||||
zlog_debug(
|
if (IS_DEBUG_OSPF_EVENT)
|
||||||
"interface %pI4 [%u] join AllDRouters Multicast group.",
|
zlog_debug(
|
||||||
&p->u.prefix4, ifindex);
|
"interface %pI4 [%u] join AllDRouters Multicast group.",
|
||||||
|
&p->u.prefix4, ifindex);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user