diff options
| author | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-19 10:17:41 +0100 |
|---|---|---|
| committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-19 10:17:41 +0100 |
| commit | d922605d28fc929d962bcc586bced0453543cc3a (patch) | |
| tree | 2444e2f1552583098b891bbc2f644a30b6c2a1b6 /ospfd/ospf_sr.c | |
| parent | 97133f7f9f3c69addde1c9375d2229008e2e979f (diff) | |
OSPFD: Fix Segment Routing Lan Adjacency TLVs
- Lan Adjacency TLVs was incorrectly formatted due to an error in
TLV size computation. Add new macro to fix this issue
- Update SR link nexthop when it corresponds to an LAN Adj SID. The nexthop
is set to the router id in the TLVi (as per draft), but we need the neighbor
IP address to set the corresponding MPLS LFIB entry
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_sr.c')
| -rw-r--r-- | ospfd/ospf_sr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index 9827eac71b..1560977ae8 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -491,6 +491,12 @@ static int compute_link_nhlfe(struct sr_link *srl) srl->nhlfe[0].ifindex = nh->oi->ifp->ifindex; srl->nhlfe[1].ifindex = nh->oi->ifp->ifindex; + /* Update neighbor address for LAN_ADJ_SID */ + if (srl->type == LAN_ADJ_SID) { + IPV4_ADDR_COPY(&srl->nhlfe[0].nexthop, &nh->src); + IPV4_ADDR_COPY(&srl->nhlfe[1].nexthop, &nh->src); + } + /* Set Input & Output Label */ if (CHECK_FLAG(srl->flags[0], EXT_SUBTLV_LINK_ADJ_SID_VFLG)) srl->nhlfe[0].label_in = srl->sid[0]; |
