In Quagga function strcmp is used to compare both ipv4 and ipv6 addresses.
This is incorrect, since there are multiple string representations of one
ipv6 address (e.g. strings 2002::a1, 2002:0:0:0:0:0:0:a1, 2002::00a1,
2002::00A1 represent one ipv6 address, 2002:0000:0000:0000:0000:0000:0000:00a1.
Possible representations are described in RFC 5952). To correctly compare
ipv6 addresses, they must be compared using IPV6_ADDR_CMP function (defined
in lib/prefix.h), which will compare addresses stored in struct in6_addr form.
In some cases calling function is not aware of underlying string address
family (AF_INET or AF_INET6). So wrapping function ip_addr_is_equal is created,
to determine AF of IP address string.
In Quagga function strcmp is used to compare both ipv4 and ipv6 addresses. This is incorrect, since there are multiple string representations of one ipv6 address (e.g. strings 2002::a1, 2002:0:0:0:0:0:0:a1, 2002::00a1, 2002::00A1 represent one ipv6 address, 2002:0000:0000:0000:0000:0000:0000:00a1. Possible representations are described in RFC 5952). To correctly compare ipv6 addresses, they must be compared using IPV6_ADDR_CMP function (defined in lib/prefix.h), which will compare addresses stored in struct in6_addr form.
In some cases calling function is not aware of underlying string address family (AF_INET or AF_INET6). So wrapping function ip_addr_is_equal is created, to determine AF of IP address string.
Tags: fix, dev, chg
Change-Id: I9a11038b0ac50613601d1ca56ce97388fbb84dbb Signed-off-by: Ilya Schepin ischepin@mera.ru