We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc5f337 commit 81e9837Copy full SHA for 81e9837
net/sctp/socket.c
@@ -357,11 +357,14 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt,
357
if (!opt->pf->af_supported(addr->sa.sa_family, opt))
358
return NULL;
359
360
- /* V4 mapped address are really of AF_INET family */
361
- if (addr->sa.sa_family == AF_INET6 &&
362
- ipv6_addr_v4mapped(&addr->v6.sin6_addr) &&
363
- !opt->pf->af_supported(AF_INET, opt))
364
- return NULL;
+ if (addr->sa.sa_family == AF_INET6) {
+ if (len < SIN6_LEN_RFC2133)
+ return NULL;
+ /* V4 mapped address are really of AF_INET family */
+ if (ipv6_addr_v4mapped(&addr->v6.sin6_addr) &&
365
+ !opt->pf->af_supported(AF_INET, opt))
366
367
+ }
368
369
/* If we get this far, af is valid. */
370
af = sctp_get_af_specific(addr->sa.sa_family);
0 commit comments