File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -335,11 +335,14 @@ static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt,
335335 if (!opt -> pf -> af_supported (addr -> sa .sa_family , opt ))
336336 return NULL ;
337337
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 ;
338+ if (addr -> sa .sa_family == AF_INET6 ) {
339+ if (len < SIN6_LEN_RFC2133 )
340+ return NULL ;
341+ /* V4 mapped address are really of AF_INET family */
342+ if (ipv6_addr_v4mapped (& addr -> v6 .sin6_addr ) &&
343+ !opt -> pf -> af_supported (AF_INET , opt ))
344+ return NULL ;
345+ }
343346
344347 /* If we get this far, af is valid. */
345348 af = sctp_get_af_specific (addr -> sa .sa_family );
You can’t perform that action at this time.
0 commit comments