Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trie.go:insert - fix proposal for Ipv4\Ipv6 in same trie #42

Open
dmineev opened this issue Aug 12, 2021 · 0 comments
Open

trie.go:insert - fix proposal for Ipv4\Ipv6 in same trie #42

dmineev opened this issue Aug 12, 2021 · 0 comments

Comments

@dmineev
Copy link

dmineev commented Aug 12, 2021

func (p *prefixTrie) insert(network rnet.Network, entry RangerEntry) (bool, error) {
        
            *                *                   *

	// No existing child, insert new leaf trie.
	if existingChild == nil || existingChild.network.Number == nil {

          *                   *                   *

	}

          *                  *                  *

	// Check whether it is necessary to insert additional path prefix between current trie and existing child,
	// in the case that inserted network diverges on its path to existing child.
	if lcb, err := network.LeastCommonBitPosition(existingChild.network); err == nil {

          *                   *                  *

	} else {
		return false, err
	}

	return existingChild.insert(network, entry)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant