lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+WQbwtnvGO+NpVwHHPxp+wQW5vZYHPHydGZ6cjNnNGhFw1zmg@mail.gmail.com>
Date:   Tue, 17 May 2022 13:28:33 +0800
From:   Geliang Tang <geliangtang@...il.com>
To:     Martin KaFai Lau <kafai@...com>
Cc:     Mat Martineau <mathew.j.martineau@...ux.intel.com>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        Nicolas Rybowski <nicolas.rybowski@...sares.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        MPTCP Upstream <mptcp@...ts.linux.dev>,
        Matthieu Baerts <matthieu.baerts@...sares.net>,
        Geliang Tang <geliang.tang@...e.com>
Subject: Re: [PATCH bpf-next v4 3/7] selftests/bpf: add MPTCP test base

Martin KaFai Lau <kafai@...com> 于2022年5月17日周二 09:18写道:
>
> On Fri, May 13, 2022 at 03:48:23PM -0700, Mat Martineau wrote:
> [ ... ]
>
> > @@ -265,7 +282,7 @@ int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts)
> >       }
> >
> >       addr_in = (struct sockaddr_in *)&addr;
> > -     fd = socket(addr_in->sin_family, type, 0);
> > +     fd = socket(addr_in->sin_family, type, opts->protocol);
> ops->protocol is the same as the server_fd's protocol ?
>
> Can that be learned from getsockopt(server_fd, SOL_SOCKET, SO_PROTOCOL, ....) ?
> Then the ops->protocol additions and related changes are not needed.

Yes, I will update this in v5.

>
> connect_to_fd_opts() has already obtained the SO_TYPE in similar way.
>
> >       if (fd < 0) {
> >               log_err("Failed to create client socket");
> >               return -1;
> > @@ -298,6 +315,16 @@ int connect_to_fd(int server_fd, int timeout_ms)
> >       return connect_to_fd_opts(server_fd, &opts);
> >  }
> >
> > +int connect_to_mptcp_fd(int server_fd, int timeout_ms)
> > +{
> > +     struct network_helper_opts opts = {
> > +             .timeout_ms = timeout_ms,
> > +             .protocol = IPPROTO_MPTCP,
> > +     };
> > +
> > +     return connect_to_fd_opts(server_fd, &opts);
> > +}
> > +
> >  int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms)
> >  {
> >       struct sockaddr_storage addr;
> > diff --git a/tools/testing/selftests/bpf/network_helpers.h b/tools/testing/selftests/bpf/network_helpers.h
> > index a4b3b2f9877b..e0feb115b2ae 100644
> > --- a/tools/testing/selftests/bpf/network_helpers.h
> > +++ b/tools/testing/selftests/bpf/network_helpers.h
> > @@ -21,6 +21,7 @@ struct network_helper_opts {
> >       const char *cc;
> >       int timeout_ms;
> >       bool must_fail;
> > +     int protocol;
> >  };
> >
> >  /* ipv4 test vector */
> > @@ -42,11 +43,14 @@ extern struct ipv6_packet pkt_v6;
> >  int settimeo(int fd, int timeout_ms);
> >  int start_server(int family, int type, const char *addr, __u16 port,
> >                int timeout_ms);
> > +int start_mptcp_server(int family, const char *addr, __u16 port,
> > +                    int timeout_ms);
> >  int *start_reuseport_server(int family, int type, const char *addr_str,
> >                           __u16 port, int timeout_ms,
> >                           unsigned int nr_listens);
> >  void free_fds(int *fds, unsigned int nr_close_fds);
> >  int connect_to_fd(int server_fd, int timeout_ms);
> > +int connect_to_mptcp_fd(int server_fd, int timeout_ms);
> >  int connect_to_fd_opts(int server_fd, const struct network_helper_opts *opts);
> >  int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms);
> >  int fastopen_connect(int server_fd, const char *data, unsigned int data_len,
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ