]> Pileus Git - ~andy/linux/blobdiff - net/sctp/sm_statefuns.c
[SCTP]: sctp_transport_{init,new}() switched to net-endian.
[~andy/linux] / net / sctp / sm_statefuns.c
index 7d722f5a31d7b636524b5f5377cbed494d8aeb26..c5362638d67257868d936a1ab6f2848209c60a8c 100644 (file)
@@ -598,6 +598,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
        struct sctp_ulpevent *ev, *ai_ev = NULL;
        int error = 0;
        struct sctp_chunk *err_chk_p;
+       union sctp_addr tmp;
 
        /* If the packet is an OOTB packet which is temporarily on the
         * control endpoint, respond with an ABORT.
@@ -665,8 +666,9 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
         */
        peer_init = &chunk->subh.cookie_hdr->c.peer_init[0];
 
+       flip_to_h(&tmp, &chunk->subh.cookie_hdr->c.peer_addr);
        if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type,
-                              &chunk->subh.cookie_hdr->c.peer_addr,
+                              &tmp,
                               peer_init, GFP_ATOMIC))
                goto nomem_init;
 
@@ -852,7 +854,7 @@ static sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep,
 
        hbinfo.param_hdr.type = SCTP_PARAM_HEARTBEAT_INFO;
        hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t));
-       hbinfo.daddr = transport->ipaddr_h;
+       hbinfo.daddr = transport->ipaddr;
        hbinfo.sent_at = jiffies;
        hbinfo.hb_nonce = transport->hb_nonce;
 
@@ -1018,7 +1020,6 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
        struct sctp_transport *link;
        sctp_sender_hb_info_t *hbinfo;
        unsigned long max_interval;
-       union sctp_addr tmp;
 
        if (!sctp_vtag_verify(chunk, asoc))
                return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -1036,8 +1037,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
        }
 
        from_addr = hbinfo->daddr;
-       flip_to_n(&tmp, &from_addr);
-       link = sctp_assoc_lookup_paddr(asoc, &tmp);
+       link = sctp_assoc_lookup_paddr(asoc, &from_addr);
 
        /* This should never happen, but lets log it if so.  */
        if (unlikely(!link)) {
@@ -5105,6 +5105,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc
        __u16 sport;
        __u16 dport;
        __u32 vtag;
+       union sctp_addr tmp;
 
        /* Get the source and destination port from the inbound packet.  */
        sport = ntohs(chunk->sctp_hdr->dest);
@@ -5135,7 +5136,8 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc
        }
 
        /* Make a transport for the bucket, Eliza... */
-       transport = sctp_transport_new(sctp_source(chunk), GFP_ATOMIC);
+       flip_to_n(&tmp, sctp_source(chunk));
+       transport = sctp_transport_new(&tmp, GFP_ATOMIC);
        if (!transport)
                goto nomem;