problems observed with IRRToolSet-4.8.2 - and the mailing list!?
Hagen Boehm
hboehm at brutus.NIC.DTAG.DE
Thu Feb 16 14:05:19 UTC 2006
Hi all,
On Fri, 10 Feb 2006 12:01:07 +0100, Ruediger Volk wrote:
> list of problems found:
> ...
> (3) We are seeing cases where resolving to route-sets
> (a) an ASnnn and
> (b) an AS-set AS-xxxx which includes ASnnn as a member
> lists some prefixes
> as members of ASnnn
> but NOT as members of AS-xxxx
> ...
> so the loss seems to happen somewhere in the IRRtoolSet code.
> Does anybody remember seeing something similar?
IMHO the bug seems to come from method
bool MPPrefixRanges::contains(MPPrefix ip) const
in src/rpsl/rpsl/prefix.cc at line 1237. Prefixes received from a database
server are stored in a vector. To verify that a prefix is not stored twice
in that vector, method "contains" is used to check whether the vector
already contains the prefix. But "contains" only check for the ip and not
for the mask or any restrictions like ^n-m.
So if 10.0.0.0/15 is already stored, then 10.0.0.0/16 gets lost since the
ip are the same.
I'm not pretty sure whether this method is also used in another context - I
still have to verify that -, but it doesn't seems likely to me.
Anyway, if you are interested in advance in the fix I've written, here it is:
--- prefix.cc.original Fri Jul 30 12:58:14 2004
+++ prefix.cc Thu Feb 16 14:48:53 2006
@@ -1235,12 +1235,25 @@
}
bool MPPrefixRanges::contains(MPPrefix ip) const {
+ // method rewritten by Hagen Boehm
MPPrefixRanges::const_iterator p;
for (p = begin(); p != end(); ++p) {
- if (p->ipv6 && ip.ipv6 && (*(p->ipv6->get_ipaddr()) == ip.get_ipaddr()) )
- return true;
- if (p->ipv4 && ip.ipv4 && (p->ipv4->get_ipaddr() == ip.ipv4->
get_ipaddr()))
- return true;
+ if (p->ipv6) {
+ if (ip.ipv6 && (p->ipv6->get_ipaddr() == ip.ipv6->get_ipaddr())
+ && (p->ipv6->get_length() == ip.ipv6->get_length())
+ && (p->ipv6->get_n() == ip.ipv6->get_n())
+ && (p->ipv6->get_m() == ip.ipv6->get_m())) {
+ return true;
+ }
+ }
+ if (p->ipv4) {
+ if (ip.ipv4 && (p->ipv4->get_ipaddr() == ip.ipv4->get_ipaddr())
+ && (p->ipv4->get_length() == ip.ipv4->get_length())
+ && (p->ipv4->get_n() == ip.ipv4->get_n())
+ && (p->ipv4->get_m() == ip.ipv4->get_m())) {
+ return true;
+ }
+ }
}
return false;
}
Best regards,
Hagen Böhm
--
# Deutsche Telekom AG -- Internet Backbone Engineering
# T-Com Headquarters
# phone: +49 251 - 7985 120
# email: hboehm at brutus.NIC.DTAG.DE
More information about the irrtoolset
mailing list