getaddrinfo.c: support MPTCP

Message ID 20250304095415.1917979-1-pizhenwei@bytedance.com (mailing list archive)
State Superseded
Headers
Series getaddrinfo.c: support MPTCP |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

zhenwei pi March 4, 2025, 9:54 a.m. UTC
  There is a lack of MPTCP support from gaih_inet_typeproto array, add
MPTCP entry.

Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 nss/getaddrinfo.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Adhemerval Zanella Netto March 10, 2025, 8:06 p.m. UTC | #1
On 04/03/25 06:54, zhenwei pi wrote:
> There is a lack of MPTCP support from gaih_inet_typeproto array, add
> MPTCP entry.
> 
> Signed-off-by: zhenwei pi <zhenwei.pi@linux.dev>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
>  nss/getaddrinfo.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c
> index 21e899ff1d..efe6ad30d5 100644
> --- a/nss/getaddrinfo.c
> +++ b/nss/getaddrinfo.c
> @@ -143,6 +143,9 @@ static const struct gaih_typeproto gaih_inet_typeproto[] =
>  #ifdef IPPROTO_SCTP
>    { SOCK_STREAM, IPPROTO_SCTP, 0, false, "sctp" },
>    { SOCK_SEQPACKET, IPPROTO_SCTP, 0, false, "sctp" },
> +#endif
> +#ifdef IPPROTO_MPTCP
> +  { SOCK_STREAM, IPPROTO_MPTCP, 0, false, "mptcp" },
>  #endif
>    { SOCK_RAW, 0, GAI_PROTO_PROTOANY|GAI_PROTO_NOSERVICE, true, "raw" },
>    { 0, 0, 0, false, "" }

This is BZ#29609 and this looks good to me.  Maybe add a testcase to check
that if you specify the protocol different than '0' it should return an
entry instead of EAI_SOCKTYPE.
  

Patch

diff --git a/nss/getaddrinfo.c b/nss/getaddrinfo.c
index 21e899ff1d..efe6ad30d5 100644
--- a/nss/getaddrinfo.c
+++ b/nss/getaddrinfo.c
@@ -143,6 +143,9 @@  static const struct gaih_typeproto gaih_inet_typeproto[] =
 #ifdef IPPROTO_SCTP
   { SOCK_STREAM, IPPROTO_SCTP, 0, false, "sctp" },
   { SOCK_SEQPACKET, IPPROTO_SCTP, 0, false, "sctp" },
+#endif
+#ifdef IPPROTO_MPTCP
+  { SOCK_STREAM, IPPROTO_MPTCP, 0, false, "mptcp" },
 #endif
   { SOCK_RAW, 0, GAI_PROTO_PROTOANY|GAI_PROTO_NOSERVICE, true, "raw" },
   { 0, 0, 0, false, "" }