diff options
author | Lou Berger <lberger@labn.net> | 2022-10-16 17:19:37 +0200 |
---|---|---|
committer | Lou Berger <lberger@labn.net> | 2022-10-21 17:27:58 +0200 |
commit | 2f30cb25747dc9657046c59ca1f378203192de26 (patch) | |
tree | e064c47134e510a7544f9990a92692e5e657fe4e /ospfd/ospf_opaque.c | |
parent | ospfd: ospf_apiserver.c - fix link local opaque LSA delete (diff) | |
download | frr-2f30cb25747dc9657046c59ca1f378203192de26.tar.xz frr-2f30cb25747dc9657046c59ca1f378203192de26.zip |
ospfd/ospfclient: add option to flush/withdrawal with zero length
default behavior is unchanged, i.e., to not zero
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'ospfd/ospf_opaque.c')
-rw-r--r-- | ospfd/ospf_opaque.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c index 261d69df3..ab647625f 100644 --- a/ospfd/ospf_opaque.c +++ b/ospfd/ospf_opaque.c @@ -2050,6 +2050,17 @@ void ospf_opaque_lsa_flush_schedule(struct ospf_lsa *lsa0) goto out; } + if (lsa->opaque_zero_len_delete && + lsa->data->length != htons(sizeof(struct lsa_header))) { + /* minimize the size of the withdrawal: */ + /* increment the sequence number and make len just header */ + /* and update checksum */ + lsa->data->ls_seqnum = lsa_seqnum_increment(lsa); + lsa->data->length = htons(sizeof(struct lsa_header)); + lsa->data->checksum = 0; + lsa->data->checksum = ospf_lsa_checksum(lsa->data); + } + /* Delete this lsa from neighbor retransmit-list. */ switch (lsa->data->type) { case OSPF_OPAQUE_LINK_LSA: |