diff options
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 6 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index b5d4a61ed7a7..59536368f79a 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1227,6 +1227,7 @@ struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *ep, | |||
1227 | struct sk_buff *skb; | 1227 | struct sk_buff *skb; |
1228 | sctp_scope_t scope; | 1228 | sctp_scope_t scope; |
1229 | struct sctp_af *af; | 1229 | struct sctp_af *af; |
1230 | union sctp_addr tmp; | ||
1230 | 1231 | ||
1231 | /* Create the bare association. */ | 1232 | /* Create the bare association. */ |
1232 | scope = sctp_scope(sctp_source(chunk)); | 1233 | scope = sctp_scope(sctp_source(chunk)); |
@@ -1239,7 +1240,8 @@ struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *ep, | |||
1239 | af = sctp_get_af_specific(ipver2af(skb->nh.iph->version)); | 1240 | af = sctp_get_af_specific(ipver2af(skb->nh.iph->version)); |
1240 | if (unlikely(!af)) | 1241 | if (unlikely(!af)) |
1241 | goto fail; | 1242 | goto fail; |
1242 | af->from_skb(&asoc->c.peer_addr, skb, 1); | 1243 | af->from_skb(&tmp, skb, 1); |
1244 | flip_to_n(&asoc->c.peer_addr, &tmp); | ||
1243 | nodata: | 1245 | nodata: |
1244 | return asoc; | 1246 | return asoc; |
1245 | 1247 | ||
@@ -1439,7 +1441,7 @@ no_hmac: | |||
1439 | goto fail; | 1441 | goto fail; |
1440 | } | 1442 | } |
1441 | 1443 | ||
1442 | if (ntohs(chunk->sctp_hdr->source) != bear_cookie->peer_addr.v4.sin_port || | 1444 | if (chunk->sctp_hdr->source != bear_cookie->peer_addr.v4.sin_port || |
1443 | ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) { | 1445 | ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) { |
1444 | *error = -SCTP_IERROR_BAD_PORTS; | 1446 | *error = -SCTP_IERROR_BAD_PORTS; |
1445 | goto fail; | 1447 | goto fail; |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 0848309773a5..174acc3c5526 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -598,6 +598,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, | |||
598 | struct sctp_ulpevent *ev, *ai_ev = NULL; | 598 | struct sctp_ulpevent *ev, *ai_ev = NULL; |
599 | int error = 0; | 599 | int error = 0; |
600 | struct sctp_chunk *err_chk_p; | 600 | struct sctp_chunk *err_chk_p; |
601 | union sctp_addr tmp; | ||
601 | 602 | ||
602 | /* If the packet is an OOTB packet which is temporarily on the | 603 | /* If the packet is an OOTB packet which is temporarily on the |
603 | * control endpoint, respond with an ABORT. | 604 | * control endpoint, respond with an ABORT. |
@@ -665,8 +666,9 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, | |||
665 | */ | 666 | */ |
666 | peer_init = &chunk->subh.cookie_hdr->c.peer_init[0]; | 667 | peer_init = &chunk->subh.cookie_hdr->c.peer_init[0]; |
667 | 668 | ||
669 | flip_to_h(&tmp, &chunk->subh.cookie_hdr->c.peer_addr); | ||
668 | if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, | 670 | if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, |
669 | &chunk->subh.cookie_hdr->c.peer_addr, | 671 | &tmp, |
670 | peer_init, GFP_ATOMIC)) | 672 | peer_init, GFP_ATOMIC)) |
671 | goto nomem_init; | 673 | goto nomem_init; |
672 | 674 | ||