[sr-dev] IPv4 and IPv6 binary comparison

Juha Heinanen jh at tutpro.com
Wed Apr 27 13:44:11 CEST 2011


Iñaki Baz Castillo writes:

> In fact, I'm thinking right now that the most suitable solution would
> be create a library providing such functions so any other module could
> internally use them (i.e. LCR for a future IPv6 addition). Opinions?

ip_addr.h already has ip_addr_cmp function.  may be it could be enhanced
to also compare ipv6 addresses.

> > if one address is ipv4 and the other ipv6 representation of ipv4 address
> > (i think there is one), will the comparison return true?
> 
> No, it would return false. I don't see the point in comparing a IPv4
> against its IPv6 representation and returning true, is it really
> useful for our scenarios?

i don't know, since i have not used ipv6 myself in sip router.

-- juha



More information about the sr-dev mailing list