Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20ac94ff authored by quakentsai(58374)'s avatar quakentsai(58374)
Browse files

CTS fail testCreateServerSocketWithPortNoBacklog

CTS fail case :
CtsLibcoreTestCases
libcore.javax.net.ServerSocketFactoryTest#testCreateServerSocketWithPortNoBacklog

patch from :
https://android-review.googlesource.com/c/platform/libcore/+/860771

Defect:
N/A

Root cause:
N/A

How to fix:
N/A

Change-Id: I7f42e6f1835efe8e23707bc94c6574d8567b83fb
parent a0204622
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -289,10 +289,14 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk)
	return reqsk_queue_len(&inet_csk(sk)->icsk_accept_queue);
}

//2019 01 09-Quaken > fix CTS fail testCreateServerSocketWithPortNoBacklog
/*
static inline int inet_csk_reqsk_queue_young(const struct sock *sk)
{
	return reqsk_queue_len_young(&inet_csk(sk)->icsk_accept_queue);
}
*/
//2019 01 09-Quaken < fix CTS fail testCreateServerSocketWithPortNoBacklog

static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk)
{
+4 −1
Original line number Diff line number Diff line
@@ -600,8 +600,11 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
	 * clogging syn queue with openreqs with exponentially increasing
	 * timeout.
	 */
	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
//2019 01 09-Quaken > fix CTS fail testCreateServerSocketWithPortNoBacklog
//	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
	if (sk_acceptq_is_full(sk))
		goto drop;
//2019 01 09-Quaken < fix CTS fail testCreateServerSocketWithPortNoBacklog

	req = inet_reqsk_alloc(&dccp_request_sock_ops, sk, true);
	if (req == NULL)
+4 −1
Original line number Diff line number Diff line
@@ -328,8 +328,11 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
	if (inet_csk_reqsk_queue_is_full(sk))
		goto drop;

	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
//2019 01 09-Quaken > fix CTS fail testCreateServerSocketWithPortNoBacklog
//	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
	if (sk_acceptq_is_full(sk))
		goto drop;
//2019 01 09-Quaken < fix CTS fail testCreateServerSocketWithPortNoBacklog

	req = inet_reqsk_alloc(&dccp6_request_sock_ops, sk, true);
	if (req == NULL)
+4 −1
Original line number Diff line number Diff line
@@ -6358,7 +6358,10 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
	 * clogging syn queue with openreqs with exponentially increasing
	 * timeout.
	 */
	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
//2019 01 09-Quaken > fix CTS fail testCreateServerSocketWithPortNoBacklog
//	if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) {
	if (sk_acceptq_is_full(sk)) {
//2019 01 09-Quaken < fix CTS fail testCreateServerSocketWithPortNoBacklog
		NET_INC_STATS(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
		goto drop;
	}