diff options
| author | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-01 14:30:34 +0100 |
|---|---|---|
| committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-01 14:30:34 +0100 |
| commit | db28a51f7e3b7ada03994e1fb4eb027fc9b37f11 (patch) | |
| tree | 3ca34024e94af3e91d17a5142258e1e978775613 /ospfd/ospf_sr.c | |
| parent | 62c9979094a6e3a809aceeae2a97d34bf5645615 (diff) | |
OSPFd: Correct Extended Prefix LSA refresh
- When Extended Prefix LSA need to be refresh, paramaters may be
taken from the wrong interface i.e. Extended Link instead of Prefix
resulting in producing an empty LSA body. Then, ospfd crash due to the
assert on LSA length in ospf_lsa_different() function: code check that
the LSA size is larger than LSA header i.e. LSA is not empty.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_sr.c')
| -rw-r--r-- | ospfd/ospf_sr.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index 43f5d0e0bf..d906a4ce59 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -1489,7 +1489,6 @@ void ospf_sr_update_prefix(struct interface *ifp, struct prefix *p) { struct listnode *node; struct sr_prefix *srp; - uint32_t rc; /* Sanity Check */ if ((ifp == NULL) || (p == NULL)) @@ -1514,10 +1513,8 @@ void ospf_sr_update_prefix(struct interface *ifp, struct prefix *p) IPV4_ADDR_COPY(&srp->nhlfe.nexthop, &p->u.prefix4); /* OK. Let's Schedule Extended Prefix LSA */ - rc = ospf_ext_schedule_prefix_index(ifp, srp->sid, - &srp->nhlfe.prefv4, srp->flags); - srp->instance = SET_OPAQUE_LSID( - OPAQUE_TYPE_EXTENDED_PREFIX_LSA, rc); + srp->instance = ospf_ext_schedule_prefix_index(ifp, + srp->sid, &srp->nhlfe.prefv4, srp->flags); /* Install NHLFE if NO-PHP is requested */ if (CHECK_FLAG(srp->flags, @@ -2021,14 +2018,13 @@ DEFUN (sr_prefix_sid, } /* Finally, update Extended Prefix LSA */ - rc = ospf_ext_schedule_prefix_index(ifp, srp->sid, - &srp->nhlfe.prefv4, srp->flags); - if (rc == 0) { + srp->instance = ospf_ext_schedule_prefix_index(ifp, srp->sid, + &srp->nhlfe.prefv4, srp->flags); + if (srp->instance) { vty_out(vty, "Unable to set index %u for prefix %s/%u\n", index, inet_ntoa(p.u.prefix4), p.prefixlen); return CMD_WARNING; } - srp->instance = SET_OPAQUE_LSID(OPAQUE_TYPE_EXTENDED_PREFIX_LSA, rc); return CMD_SUCCESS; } |
