diff options
author | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-05 20:24:17 +0100 |
---|---|---|
committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-05 20:24:17 +0100 |
commit | 6aaf0fdd0185f156359dcce5b8ff3620be424092 (patch) | |
tree | 9276e7cf35ffb2a5ad7af2436065062162f8ed72 /ospfd/ospf_ri.c | |
parent | OSPFd: Fix ospfd crash during CI (diff) | |
download | frr-6aaf0fdd0185f156359dcce5b8ff3620be424092.tar.xz frr-6aaf0fdd0185f156359dcce5b8ff3620be424092.zip |
OSPFd: Fix Opaque LSA filtering in Segment Routing
Opaque LSA were incorrectly filtered. LSA Type 1 with a
router id set to 4.x.x.x or 7.x.x.x. or 8.x.x.x are not correctly
filtered and pass to Segment Routing as wrong Opaque LSA of type
Router Information, Extended Prefix respectively Extended Link.
- Add Opaque LSA check to the filter
The CLI command 'segment-routing prefix' didn't check if a same prefix
already exist in SRDB resulting to multiple entries in the SRDB for the
same prefix.
- Update prefix intead of adding a new one if already present in the SRDB
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_ri.c')
-rw-r--r-- | ospfd/ospf_ri.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c index a1d20fdd6..7c7a6fd79 100644 --- a/ospfd/ospf_ri.c +++ b/ospfd/ospf_ri.c @@ -1051,8 +1051,9 @@ static int ospf_router_info_lsa_update(struct ospf_lsa *lsa) return -1; } - /* Check if it is not my LSA */ - if (IS_LSA_SELF(lsa)) + /* Process only Opaque LSA */ + if ((lsa->data->type != OSPF_OPAQUE_AREA_LSA) + && (lsa->data->type != OSPF_OPAQUE_AS_LSA)) return 0; /* Process only Router Information LSA */ @@ -1060,6 +1061,10 @@ static int ospf_router_info_lsa_update(struct ospf_lsa *lsa) OPAQUE_TYPE_ROUTER_INFORMATION_LSA) return 0; + /* Check if it is not my LSA */ + if (IS_LSA_SELF(lsa)) + return 0; + /* Check if Router Info & Segment Routing are enable */ if (!OspfRI.enabled || !OspfRI.sr_info.enabled) return 0; |