В письме от 9 ноября 2013 07:42:06 Вы написали: > Hi, > > I applied this code manually: > > + if ((v1.type == T_IP) && (v2.type == T_PREFIX_SET)) { > + v1.val.px.len = MAX_PREFIX_LENGTH; > + return trie_match_fprefix(v2.val.ti, &v1.val.px); > + } > > To filter.c > > However maybe the patch failed because I don't have the following: > > if (v2.type != T_SET) > return CMP_ERROR; > > > Maybe the patch that was sent was within a different branch than the main > 1.3.11 that's available for download? >
Oh sorry, John, I patch really was made on top of current upstream tree, not 1.3.11. In attachment udpated patch version applied on top of 1.3.11 stable tree. Sorry for that. And yes, really according to documentation we could match only on set with elements of same tyme. On the other hand, an ip type may be easily represented as prefix with length of max AFI prefix length (32 - IPv4, 128 - IPv6, so I see no problem using this conversion of ip to prefix type. Moreover on IPv4 BIRD build there is implicit conversion of ip type to quad as on IPv4 they basically represent value with same format. Thanks for your note. -- SP5474-RIPE Sergey Popovich
diff -urN a/filter/filter.c b/filter/filter.c --- a/filter/filter.c 2013-07-28 21:48:28.000000000 +0300 +++ b/filter/filter.c 2013-11-11 10:05:04.358003244 +0200 @@ -412,6 +412,11 @@ if ((v1.type == T_PREFIX) && (v2.type == T_PREFIX_SET)) return trie_match_fprefix(v2.val.ti, &v1.val.px); + if ((v1.type == T_IP) && (v2.type == T_PREFIX_SET)) { + v1.val.px.len = MAX_PREFIX_LENGTH; + return trie_match_fprefix(v2.val.ti, &v1.val.px); + } + if ((v1.type == T_CLIST) && (v2.type == T_SET)) return clist_match_set(v1.val.ad, v2.val.t);