We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 706a813 commit fb2f3afCopy full SHA for fb2f3af
net/sctp/socket.c
@@ -335,11 +335,14 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt,
335
if (!opt->pf->af_supported(addr->sa.sa_family, opt))
336
return NULL;
337
338
- /* V4 mapped address are really of AF_INET family */
339
- if (addr->sa.sa_family == AF_INET6 &&
340
- ipv6_addr_v4mapped(&addr->v6.sin6_addr) &&
341
- !opt->pf->af_supported(AF_INET, opt))
342
- 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) &&
343
+ !opt->pf->af_supported(AF_INET, opt))
344
345
+ }
346
347
/* If we get this far, af is valid. */
348
af = sctp_get_af_specific(addr->sa.sa_family);
0 commit comments