aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 20:10:20 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:26:46 -0500
commit4bdf4b5fe22c26750c39fdd2939a5f33df0cc341 (patch)
tree36daeb8ec4543df2e02e51a11d13852d4eb1fc3c /net/sctp/sm_make_chunk.c
parentb488c7dd58f61e07b54e5d286c7b45c43dd52f1a (diff)
[SCTP]: Switch sctp_assoc_add_peer() 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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 632a1159610..2c887d3f391 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1842,6 +1842,7 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
1842 struct sctp_transport *transport; 1842 struct sctp_transport *transport;
1843 struct list_head *pos, *temp; 1843 struct list_head *pos, *temp;
1844 char *cookie; 1844 char *cookie;
1845 union sctp_addr tmp;
1845 1846
1846 /* We must include the address that the INIT packet came from. 1847 /* We must include the address that the INIT packet came from.
1847 * This is the only address that matters for an INIT packet. 1848 * This is the only address that matters for an INIT packet.
@@ -1853,9 +1854,11 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
1853 * added as the primary transport. The source address seems to 1854 * added as the primary transport. The source address seems to
1854 * be a a better choice than any of the embedded addresses. 1855 * be a a better choice than any of the embedded addresses.
1855 */ 1856 */
1856 if (peer_addr) 1857 if (peer_addr) {
1857 if(!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) 1858 flip_to_n(&tmp, peer_addr);
1859 if(!sctp_assoc_add_peer(asoc, &tmp, gfp, SCTP_ACTIVE))
1858 goto nomem; 1860 goto nomem;
1861 }
1859 1862
1860 /* Process the initialization parameters. */ 1863 /* Process the initialization parameters. */
1861 1864
@@ -2016,6 +2019,7 @@ static int sctp_process_param(struct sctp_association *asoc,
2016 sctp_scope_t scope; 2019 sctp_scope_t scope;
2017 time_t stale; 2020 time_t stale;
2018 struct sctp_af *af; 2021 struct sctp_af *af;
2022 union sctp_addr tmp;
2019 2023
2020 /* We maintain all INIT parameters in network byte order all the 2024 /* We maintain all INIT parameters in network byte order all the
2021 * time. This allows us to not worry about whether the parameters 2025 * time. This allows us to not worry about whether the parameters
@@ -2029,9 +2033,10 @@ static int sctp_process_param(struct sctp_association *asoc,
2029 case SCTP_PARAM_IPV4_ADDRESS: 2033 case SCTP_PARAM_IPV4_ADDRESS:
2030 af = sctp_get_af_specific(param_type2af(param.p->type)); 2034 af = sctp_get_af_specific(param_type2af(param.p->type));
2031 af->from_addr_param(&addr, param.addr, asoc->peer.port, 0); 2035 af->from_addr_param(&addr, param.addr, asoc->peer.port, 0);
2036 flip_to_n(&tmp, &addr);
2032 scope = sctp_scope(peer_addr); 2037 scope = sctp_scope(peer_addr);
2033 if (sctp_in_scope(&addr, scope)) 2038 if (sctp_in_scope(&tmp, scope))
2034 if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED)) 2039 if (!sctp_assoc_add_peer(asoc, &tmp, gfp, SCTP_UNCONFIRMED))
2035 return 0; 2040 return 0;
2036 break; 2041 break;
2037 2042
@@ -2434,7 +2439,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2434 * Due to Resource Shortage'. 2439 * Due to Resource Shortage'.
2435 */ 2440 */
2436 2441
2437 peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC, SCTP_UNCONFIRMED); 2442 peer = sctp_assoc_add_peer(asoc, &tmp_addr, GFP_ATOMIC, SCTP_UNCONFIRMED);
2438 if (!peer) 2443 if (!peer)
2439 return SCTP_ERROR_RSRC_LOW; 2444 return SCTP_ERROR_RSRC_LOW;
2440 2445