On Fri, Dec 23, 2016 at 10:35:13PM +0100, [email protected] wrote: > I return true if the largest network contains the smaller. The order of > networks are not important. > > I wrote this code a long time ago, I'm not remember exactly. Maybe I > wrote bullshit. > > I write this code for testing: > > 7 a = core.parse_addr("192.168.1.0/24") > 8 b = core.parse_addr("192.168.1.10/32") > 9 > 10 print_r(core.match_addr(a, b)) > 11 print_r(core.match_addr(b, a)) > 12 > 13 a = core.parse_addr("193.168.1.0/24") > 14 b = core.parse_addr("192.168.1.10/32") > 15 > 16 print_r(core.match_addr(a, b)) > 17 print_r(core.match_addr(b, a)) > > The result is: > > (boolean) true > (boolean) true > (boolean) false > (boolean) false > > It is the expected result.
OK, then I'll have to recheck the code because I must be missing something. Thanks, Willy

