public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] getsockname01: Add case for errno EINVAL
Date: Thu, 16 May 2024 03:43:00 +0200	[thread overview]
Message-ID: <20240516014300.GE260285@pevik> (raw)
In-Reply-To: <20240422083528.28355-1-xuyang2018.jy@fujitsu.com>

Hi Xu,

...
> +++ b/testcases/kernel/syscalls/getsockname/getsockname01.c
> @@ -12,6 +12,7 @@
>   * - EBADF on a not open file
>   * - ENOTSOCK on a file descriptor not linked to a socket
>   * - EFAULT on invalid socket buffer o invalid socklen
> + * - EINVALI on an invalid addrlen
>   */

>  #include "tst_test.h"
> @@ -19,6 +20,7 @@
>  static struct sockaddr_in sin0, fsin1;
>  static int sock_null, sock_bind, sock_fake;
>  static socklen_t sinlen;
> +static socklen_t sininval;

Merged with following changes:

static socklen_t sininval = -1;


>  static struct test_case {
>  	int *sock;
> @@ -37,6 +39,8 @@ static struct test_case {
>  		.experrno = EFAULT, "invalid aligned salen"},
>  	{ .sock = &sock_bind, .sockaddr = &fsin1, .addrlen = (socklen_t *) 1,
>  		.experrno = EFAULT, "invalid unaligned salen"},
> +	{ .sock = &sock_bind, .sockaddr = &fsin1, .addrlen = &sininval,
> +		.experrno = EINVAL, "invalid socklen"},
>  };

>  static void check_getsockname(unsigned int nr)
> @@ -57,6 +61,7 @@ static void setup(void)
>  	sock_bind = SAFE_SOCKET(PF_INET, SOCK_STREAM, 0);
>  	SAFE_BIND(sock_bind, (struct sockaddr *)&sin0, sizeof(sin0));
>  	sinlen = sizeof(sin0);
> +	sininval = -1;

and thus removed it here.

Thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2024-05-16  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  8:35 [LTP] [PATCH] getsockname01: Add case for errno EINVAL Yang Xu via ltp
2024-05-16  1:43 ` Petr Vorel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240516014300.GE260285@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox