Skip to content

Commit

Permalink
sctp: Use ipv6_addr_diff() in sctp_v6_addr_match_len().
Browse files Browse the repository at this point in the history
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YOSHIFUJI Hideaki / 吉藤英明 authored and David S. Miller committed Mar 31, 2010
1 parent d57b8fb commit de7737e
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,20 +276,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
union sctp_addr *s2)
{
struct in6_addr *a1 = &s1->v6.sin6_addr;
struct in6_addr *a2 = &s2->v6.sin6_addr;
int i, j;

for (i = 0; i < 4 ; i++) {
__be32 a1xora2;

a1xora2 = a1->s6_addr32[i] ^ a2->s6_addr32[i];

if ((j = fls(ntohl(a1xora2))))
return (i * 32 + 32 - j);
}

return (i*32);
return ipv6_addr_diff(&s1->v6.sin6_addr, &s2->v6.sin6_addr);
}

/* Fills in the source address(saddr) based on the destination address(daddr)
Expand Down

0 comments on commit de7737e

Please sign in to comment.