summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ext.c
diff options
context:
space:
mode:
authorOlivier Dugeon <olivier.dugeon@orange.com>2018-02-05 20:24:17 +0100
committerOlivier Dugeon <olivier.dugeon@orange.com>2018-02-05 20:24:17 +0100
commit6aaf0fdd0185f156359dcce5b8ff3620be424092 (patch)
tree9276e7cf35ffb2a5ad7af2436065062162f8ed72 /ospfd/ospf_ext.c
parentOSPFd: Fix ospfd crash during CI (diff)
downloadfrr-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_ext.c')
-rw-r--r--ospfd/ospf_ext.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ospfd/ospf_ext.c b/ospfd/ospf_ext.c
index 819a695e0..d42476b6d 100644
--- a/ospfd/ospf_ext.c
+++ b/ospfd/ospf_ext.c
@@ -780,6 +780,11 @@ static int ospf_ext_link_lsa_update(struct ospf_lsa *lsa)
return -1;
}
+ /* Process only Opaque LSA */
+ if ((lsa->data->type != OSPF_OPAQUE_AREA_LSA)
+ && (lsa->data->type != OSPF_OPAQUE_AS_LSA))
+ return 0;
+
/* Process only Extended Link LSA */
if (GET_OPAQUE_TYPE(ntohl(lsa->data->id.s_addr))
!= OPAQUE_TYPE_EXTENDED_LINK_LSA)
@@ -808,8 +813,9 @@ static int ospf_ext_pref_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 Extended Prefix LSA */
@@ -817,6 +823,10 @@ static int ospf_ext_pref_lsa_update(struct ospf_lsa *lsa)
!= OPAQUE_TYPE_EXTENDED_PREFIX_LSA)
return 0;
+ /* Check if it is not my LSA */
+ if (IS_LSA_SELF(lsa))
+ return 0;
+
/* Check if Extended is enable */
if (!OspfEXT.enabled)
return 0;