diff options
| author | Lou Berger <lberger@labn.net> | 2022-10-16 15:19:37 +0000 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2022-10-29 14:38:46 +0000 |
| commit | 3e95e20a6acb39c543261a36921de4fca23fdec9 (patch) | |
| tree | e6b7034228089fea1d19cdc34866c29fc35749b6 /ospfd/ospf_opaque.c | |
| parent | d6eda57ab057d3c44373428a3e23c5c53e4bc105 (diff) | |
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>
(cherry picked from commit 2f30cb25747dc9657046c59ca1f378203192de26)
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 261d69df33..ab647625fe 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: |
