diff options
| author | David Lamparter <equinox@diac24.net> | 2019-07-29 14:44:26 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-08-02 11:29:03 +0200 | 
| commit | 5af13f54dc3b1a6f65052af7a2581354fa719ad0 (patch) | |
| tree | 9618ff3876e4d31cf75c5785fb445c46d36f415c /ospfd/ospf_flood.c | |
| parent | fd9a1d5afe1c8bcfacb808249e3a1658fc944a0a (diff) | |
ospfd: re-fix default origination check
ospf->external[DEFAULT_ROUTE] and zclient->default_information don't
line up with each other; the former is only used for "originate always".
Fixes: #4237
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'ospfd/ospf_flood.c')
| -rw-r--r-- | ospfd/ospf_flood.c | 23 | 
1 files changed, 19 insertions, 4 deletions
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index 168dcee449..1d85a04984 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -83,6 +83,9 @@ struct external_info *ospf_external_info_check(struct ospf *ospf,  	struct as_external_lsa *al;  	struct prefix_ipv4 p;  	struct route_node *rn; +	struct list *ext_list; +	struct listnode *node; +	struct ospf_external *ext;  	int type;  	al = (struct as_external_lsa *)lsa->data; @@ -105,10 +108,6 @@ struct external_info *ospf_external_info_check(struct ospf *ospf,  					      ospf->vrf_id));  		// Pending: check for MI above.  		if (redist_on) { -			struct list *ext_list; -			struct listnode *node; -			struct ospf_external *ext; -  			ext_list = ospf->external[type];  			if (!ext_list)  				continue; @@ -129,6 +128,22 @@ struct external_info *ospf_external_info_check(struct ospf *ospf,  		}  	} +	if (is_prefix_default(&p) && ospf->external[DEFAULT_ROUTE]) { +		ext_list = ospf->external[DEFAULT_ROUTE]; + +		for (ALL_LIST_ELEMENTS_RO(ext_list, node, ext)) { +			if (!ext->external_info) +				continue; + +			rn = route_node_lookup(ext->external_info, +					       (struct prefix *)&p); +			if (!rn) +				continue; +			route_unlock_node(rn); +			if (rn->info != NULL) +				return (struct external_info *)rn->info; +		} +	}  	return NULL;  }  | 
