Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1388286 > unrolled thread

[PATCH 3.2 102/115] sctp: lack the check for ports in sctp_v6_cmp_addr

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-04-27 01:30 +0200
Last post2016-04-27 01:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.2 102/115] sctp: lack the check for ports in  sctp_v6_cmp_addr Ben Hutchings <ben@decadent.org.uk> - 2016-04-27 01:30 +0200

#1388286 — [PATCH 3.2 102/115] sctp: lack the check for ports in sctp_v6_cmp_addr

FromBen Hutchings <ben@decadent.org.uk>
Date2016-04-27 01:30 +0200
Subject[PATCH 3.2 102/115] sctp: lack the check for ports in sctp_v6_cmp_addr
Message-ID<rskAB-7Vw-99@gated-at.bofh.it>
3.2.80-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Xin Long <lucien.xin@gmail.com>

[ Upstream commit 40b4f0fd74e46c017814618d67ec9127ff20f157 ]

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 <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/sctp/ipv6.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -515,6 +515,8 @@ static int sctp_v6_cmp_addr(const union
 		}
 		return 0;
 	}
+	if (addr1->v6.sin6_port != addr2->v6.sin6_port)
+		return 0;
 	if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
 		return 0;
 	/* If this is a linklocal address, compare the scope_id. */

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web