Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update prefix len in Mtrie bucket as well
Right now, if mtrie already contains more specific entries and if a less specific entry is added, only non-matching leaves are updated with less specific entry's prefix len. The matching buckets also need to be updated with prefix len. Not updating the prefix len in buckets, results in, not collapsing the tree, if these less specific entries are deleted. For example, in an empty tree, 8.1.1.10/32 -> nh1 is added. This results in, at level 1 bucket 8, level 2 bucket 1, level 3 bucket 1 to contain prefix len as 0 and level 4 bucket 10 to contain prefix len as 32. The other leaves in level 4 (like 8.1.1.1 till 8.1.1.255 except 10) also contain prefix len as 0. After this 8.1.1.0/24 -> nh2 is added. Currently the prefix len of 24 is updated only in the leaves like, 8.1.1.1 till 8.1.1.255. Ideally the prefix len 24 should be updated in level 3 bucket 1 as well. Not updating this, leads to issues while collapsing level 3 buckets. Fixes: 1) Prefix len is updated in the matching buckets as well 2) In the label flags, if LABEL_VALID flag not set, the label stored does not have any meaning. But while collapsing the bucket the labels are also compared leading to non-collapse. The labels need to be compared only if the LABEL_VALID flag is set. To over come this, if the LABEL_VALID is not set, the label is stored as -1, so that they are comparable even if flag is not set 3) In 'rt' utility, the replacment len incase of delete is wrongly initialised to 100. This is rectified. Change-Id: Iebff1b7698e7cac2fd9a22d8ec2807a066666e08 closes-bug: #1605748
- Loading branch information
1 parent
fd8d047
commit 7aaadbd
Showing
2 changed files
with
52 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters