diff options
| author | rgirada <rgirada@vmware.com> | 2022-01-05 09:45:33 -0800 | 
|---|---|---|
| committer | rgirada <rgirada@vmware.com> | 2022-01-22 04:07:59 -0800 | 
| commit | a8c22275fecfd10f0f2cd8d56b74f9701b6709ce (patch) | |
| tree | dd8ea4414b94787908f6096dc6d5e0ffc0004e67 /ospfd/ospf_asbr.c | |
| parent | 9e84443acac051c31e504d8da657c2776332edf5 (diff) | |
ospfd: Modifying LSID generation algorithm
Description:
	This LSID alogithm added as per rcf2328 Appendex-E recommendation.
	This applies only for AS-external lsas and summary lsas.
	As an example of the algorithm, consider its operation when the
        following sequence of events occurs in a single router (Router A).
        (1) Router A wants to originate an AS-external-LSA for
            [10.0.0.0,255.255.255.0]:
            (a) A Link State ID of 10.0.0.0 is used.
        (2) Router A then wants to originate an AS-external-LSA for
            [10.0.0.0,255.255.0.0]:
            (a) The LSA for [10.0.0,0,255.255.255.0] is reoriginated using a
                new Link State ID of 10.0.0.255.
            (b) A Link State ID of 10.0.0.0 is used for
                [10.0.0.0,255.255.0.0].
        (3) Router A then wants to originate an AS-external-LSA for
            [10.0.0.0,255.0.0.0]:
            (a) The LSA for [10.0.0.0,255.255.0.0] is reoriginated using a
                new Link State ID of 10.0.255.255.
            (b) A Link State ID of 10.0.0.0 is used for
                [10.0.0.0,255.0.0.0].
            (c) The network [10.0.0.0,255.255.255.0] keeps its Link State ID
                of 10.0.0.255.
Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Diffstat (limited to 'ospfd/ospf_asbr.c')
| -rw-r--r-- | ospfd/ospf_asbr.c | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c index 000c62e305..b9878ef7ee 100644 --- a/ospfd/ospf_asbr.c +++ b/ospfd/ospf_asbr.c @@ -223,8 +223,15 @@ struct ospf_lsa *ospf_external_info_find_lsa(struct ospf *ospf,  	id.s_addr = p->prefix.s_addr | (~mask.s_addr);  	lsa = ospf_lsdb_lookup_by_id(ospf->lsdb, OSPF_AS_EXTERNAL_LSA, id,  				     ospf->router_id); -	if (lsa) +	if (lsa) { +		if (p->prefixlen == IPV4_MAX_BITLEN) { +			al = (struct as_external_lsa *)lsa->data; + +			if (mask.s_addr != al->mask.s_addr) +				return NULL; +		}  		return lsa; +	}  	lsa = ospf_lsdb_lookup_by_id(ospf->lsdb, OSPF_AS_EXTERNAL_LSA,  				     p->prefix, ospf->router_id);  | 
