diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 17:09:17 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-02 21:26:43 -0800 |
commit | 9b1dfad011d409bc56476a81810342751645ee54 (patch) | |
tree | 10946b9e5558714db25c030b9241dabca52d479f /net/sctp/sm_make_chunk.c | |
parent | f235fca389f23cd6c9e0f466611bb2d6a05ae758 (diff) |
[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>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index b5d4a61ed7a..59536368f79 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, 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 @@ struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *ep, 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 @@ no_hmac: 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; |