Skip to content

Commit

Permalink
SCTP: IPv4 mapped addr not returned in SCTPv6 accept()
Browse files Browse the repository at this point in the history
An accept() call on a SCTPv6 socket that returns due to connection of
a IPv4 mapped peer will fill out the 'struct sockaddr' with a zero
IPv6 address instead of the IPv4 mapped address of the peer.

This is due to the v4mapped flag not getting copied into the new
socket on accept() as well as a missing check for INET6 socket type in
sctp_v4_to_sk_*addr().

Signed-off-by: Dave Johnson <djohnson@sw.starentnetworks.com>
Cc: Srinivas Akkipeddi <sakkiped@starentnetworks.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
  • Loading branch information
Dave Johnson authored and Vlad Yasevich committed Aug 1, 2007
1 parent cc121fa commit b225b88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
newsctp6sk = (struct sctp6_sock *)newsk;
inet_sk(newsk)->pinet6 = &newsctp6sk->inet6;

sctp_sk(newsk)->v4mapped = sctp_sk(sk)->v4mapped;

newinet = inet_sk(newsk);
newnp = inet6_sk(newsk);

Expand Down

0 comments on commit b225b88

Please sign in to comment.