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, "" } diff --git a/nss/tst-getaddrinfo3.c b/nss/tst-getaddrinfo3.c index 5077f311fc..caea19b27f 100644 --- a/nss/tst-getaddrinfo3.c +++ b/nss/tst-getaddrinfo3.c @@ -144,6 +144,32 @@ getaddrinfo test %d return address of family %d, expected %d\n", \ hints.ai_socktype = SOCK_STREAM; T (10, 0, "::ffff:127.0.0.1", AF_INET6, "::ffff:127.0.0.1"); +#ifdef IPPROTO_MPTCP + memset (&hints, '\0', sizeof (hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_MPTCP; + T (11, 0, "127.0.0.1", AF_INET, "127.0.0.1"); + + memset (&hints, '\0', sizeof (hints)); + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_MPTCP; + T (12, 0, "127.0.0.1", AF_INET, "127.0.0.1"); + + memset (&hints, '\0', sizeof (hints)); + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_MPTCP; + T (13, 0, "::ffff:127.0.0.1", AF_INET6, "::ffff:127.0.0.1"); + + memset (&hints, '\0', sizeof (hints)); + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_MPTCP; + T (14, 0, "::ffff:127.0.0.1", AF_INET6, "::ffff:127.0.0.1"); +#endif + return result; }