Skip to content

IPv4 and IPv6 collision #2

@fishnux

Description

@fishnux

There seems to be a collision with the following specific CIDRs:

  • 42.0.0.0/22
  • 2a00::/22
package main

import (
	"fmt"
	"github.com/asergeyev/nradix"
)

func main() {
	tr := nradix.NewTree(0)
	
	err := tr.AddCIDR("42.0.0.0/22", "Got 42.0.0.0/22")
	if err != nil {
		fmt.Print(err)
	}

	inf, err := tr.FindCIDR("2a00::/22")
	if err != nil {
		fmt.Print(err)
	}
	
	fmt.Print(inf)
}

https://play.golang.org/p/xQiaBZQZkWi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions