Skip to content

Commit

Permalink
totemip: Properly detect ipv6 address
Browse files Browse the repository at this point in the history
Commit a853b61 introduced regression in finding IPv6 address. For IPv6,
IFA_ADDRESS must be checked, instead of IFA_LOCAL, because IFA_LOCAL is
returned empty.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
jfriesse committed Jan 23, 2013
1 parent 28c5907 commit d76759e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions exec/totemip.c
Expand Up @@ -598,6 +598,13 @@ int totemip_iface_check(struct totem_ip_address *bindnet,

parse_rtattr(tb, IFA_MAX, IFA_RTA(ifa), len);

if (ifa->ifa_family == AF_INET6 && tb[IFA_ADDRESS]) {
memcpy(ipaddr.addr, RTA_DATA(tb[IFA_ADDRESS]), TOTEMIP_ADDRLEN);
if (totemip_equal(&ipaddr, bindnet)) {
found_if = 1;
exact_match_found = 1;
}
}
if (tb[IFA_LOCAL]) {
memcpy(ipaddr.addr, RTA_DATA(tb[IFA_LOCAL]), TOTEMIP_ADDRLEN);
if (totemip_equal(&ipaddr, bindnet)) {
Expand Down

0 comments on commit d76759e

Please sign in to comment.