• Matthieu Boutier's avatar
    Fix bug allowing the comparison of v4 and v6 prefixes. · e687a58f
    Matthieu Boutier authored
    When the v6 prefix is ::/0, then it is considered as less specific than
    any v4-mapped prefix.
    
    Remark that "no source prefix" is encoded by "src_plen == 0".  This
    might be an issue, since "src_plen == 0" means ::/0, a v6 prefix.  So
    the route (1.1.1.1/32 from 0.0.0.0/0) is internally represented by
    (1.1.1.1/32 from ::/0).  When compared with  (::/0 from 2001:db8::/32),
    the two source prefixes are comparable.  This is not a problem in
    practice, since 2 pairs of prefixes are disjoint whether the dst
    prefixes or the src prefixes are disjoint.
    e687a58f
util.c 12.1 KB