[SCTP]: Switch sctp_cookie ->peer_addr to net-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b5d4a61..5953636 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1227,6 +1227,7 @@
 	struct sk_buff *skb;
 	sctp_scope_t scope;
 	struct sctp_af *af;
+	union sctp_addr tmp;
 
 	/* Create the bare association.  */
 	scope = sctp_scope(sctp_source(chunk));
@@ -1239,7 +1240,8 @@
 	af = sctp_get_af_specific(ipver2af(skb->nh.iph->version));
 	if (unlikely(!af))
 		goto fail;
-	af->from_skb(&asoc->c.peer_addr, skb, 1);
+	af->from_skb(&tmp, skb, 1);
+	flip_to_n(&asoc->c.peer_addr, &tmp);
 nodata:
 	return asoc;
 
@@ -1439,7 +1441,7 @@
 		goto fail;
 	}
 
-	if (ntohs(chunk->sctp_hdr->source) != bear_cookie->peer_addr.v4.sin_port ||
+	if (chunk->sctp_hdr->source != bear_cookie->peer_addr.v4.sin_port ||
 	    ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) {
 		*error = -SCTP_IERROR_BAD_PORTS;
 		goto fail;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 0848309..174acc3 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -598,6 +598,7 @@
 	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 @@
 	 */
 	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;