aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 20:23:01 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:27:02 -0500
commit8cec6b80664eb20b0c033fd20d2c7ed15621437f (patch)
tree8bfe0e2539f221e724f5c5de543c3bf2c5912373 /net/sctp/socket.c
parentb3f5b3b6654422bb0a6ef745fe4d11a4f01d006a (diff)
[SCTP]: We need to be careful when copying to sockaddr_storage.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index e527267a0536..adbe531fdedc 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3202,8 +3202,8 @@ static int sctp_getsockopt_sctp_status(struct sock *sk, int len,
3202 status.sstat_outstrms = asoc->c.sinit_num_ostreams; 3202 status.sstat_outstrms = asoc->c.sinit_num_ostreams;
3203 status.sstat_fragmentation_point = asoc->frag_point; 3203 status.sstat_fragmentation_point = asoc->frag_point;
3204 status.sstat_primary.spinfo_assoc_id = sctp_assoc2id(transport->asoc); 3204 status.sstat_primary.spinfo_assoc_id = sctp_assoc2id(transport->asoc);
3205 flip_to_n((union sctp_addr *)&status.sstat_primary.spinfo_address, 3205 memcpy(&status.sstat_primary.spinfo_address, &transport->ipaddr,
3206 &transport->ipaddr_h); 3206 transport->af_specific->sockaddr_len);
3207 /* Map ipv4 address into v4-mapped-on-v6 address. */ 3207 /* Map ipv4 address into v4-mapped-on-v6 address. */
3208 sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), 3208 sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk),
3209 (union sctp_addr *)&status.sstat_primary.spinfo_address); 3209 (union sctp_addr *)&status.sstat_primary.spinfo_address);
@@ -4173,8 +4173,8 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
4173 if (!asoc->peer.primary_path) 4173 if (!asoc->peer.primary_path)
4174 return -ENOTCONN; 4174 return -ENOTCONN;
4175 4175
4176 flip_to_n((union sctp_addr *)&prim.ssp_addr, 4176 memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr,
4177 &asoc->peer.primary_path->ipaddr_h); 4177 asoc->peer.primary_path->af_specific->sockaddr_len);
4178 4178
4179 sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, 4179 sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp,
4180 (union sctp_addr *)&prim.ssp_addr); 4180 (union sctp_addr *)&prim.ssp_addr);