Skip to content

Commit 40b4f0f

Browse files
lxindavem330
authored andcommitted
sctp: lack the check for ports in sctp_v6_cmp_addr
As the member .cmp_addr of sctp_af_inet6, sctp_v6_cmp_addr should also check the port of addresses, just like sctp_v4_cmp_addr, cause it's invoked by sctp_cmp_addr_exact(). Now sctp_v6_cmp_addr just check the port when two addresses have different family, and lack the port check for two ipv6 addresses. that will make sctp_hash_cmp() cannot work well. so fix it by adding ports comparison in sctp_v6_cmp_addr(). Signed-off-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f0da74b commit 40b4f0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/sctp/ipv6.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
526526
}
527527
return 0;
528528
}
529+
if (addr1->v6.sin6_port != addr2->v6.sin6_port)
530+
return 0;
529531
if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
530532
return 0;
531533
/* If this is a linklocal address, compare the scope_id. */

0 commit comments

Comments
 (0)