aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sctp/constants.h2
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--include/net/sctp/sm.h2
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--net/sctp/associola.c2
-rw-r--r--net/sctp/ipv6.c4
-rw-r--r--net/sctp/protocol.c2
-rw-r--r--net/sctp/sm_make_chunk.c18
8 files changed, 17 insertions, 17 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 6c632e26f72d..5ddb85599863 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -356,7 +356,7 @@ typedef enum {
356 * addresses. 356 * addresses.
357 */ 357 */
358#define IS_IPV4_UNUSABLE_ADDRESS(a) \ 358#define IS_IPV4_UNUSABLE_ADDRESS(a) \
359 ((INADDR_BROADCAST == *a) || \ 359 ((htonl(INADDR_BROADCAST) == *a) || \
360 (MULTICAST(*a)) || \ 360 (MULTICAST(*a)) || \
361 (((unsigned char *)(a))[0] == 0) || \ 361 (((unsigned char *)(a))[0] == 0) || \
362 ((((unsigned char *)(a))[0] == 198) && \ 362 ((((unsigned char *)(a))[0] == 198) && \
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 764e3af5be93..215461f18db1 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -585,7 +585,7 @@ static inline int ipver2af(__u8 ipver)
585} 585}
586 586
587/* Convert from an address parameter type to an address family. */ 587/* Convert from an address parameter type to an address family. */
588static inline int param_type2af(__u16 type) 588static inline int param_type2af(__be16 type)
589{ 589{
590 switch (type) { 590 switch (type) {
591 case SCTP_PARAM_IPV4_ADDRESS: 591 case SCTP_PARAM_IPV4_ADDRESS:
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index a7b935a76a62..3269ed1cc222 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -243,7 +243,7 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *,
243struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, 243struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *,
244 union sctp_addr *, 244 union sctp_addr *,
245 struct sockaddr *, 245 struct sockaddr *,
246 int, __u16); 246 int, __be16);
247struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, 247struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
248 union sctp_addr *addr); 248 union sctp_addr *addr);
249struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, 249struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 5596f5d97ed2..ca77bc5b7ff5 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1482,7 +1482,7 @@ struct sctp_association {
1482 /* This mask is used to disable sending the ASCONF chunk 1482 /* This mask is used to disable sending the ASCONF chunk
1483 * with specified parameter to peer. 1483 * with specified parameter to peer.
1484 */ 1484 */
1485 __u16 addip_disabled_mask; 1485 __be16 addip_disabled_mask;
1486 1486
1487 struct sctp_inithdr i; 1487 struct sctp_inithdr i;
1488 int cookie_len; 1488 int cookie_len;
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index ed0445fe85e7..a5d7abba89e4 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -868,7 +868,7 @@ struct sctp_transport *sctp_assoc_lookup_tsn(struct sctp_association *asoc,
868 struct list_head *entry, *pos; 868 struct list_head *entry, *pos;
869 struct sctp_transport *transport; 869 struct sctp_transport *transport;
870 struct sctp_chunk *chunk; 870 struct sctp_chunk *chunk;
871 __u32 key = htonl(tsn); 871 __be32 key = htonl(tsn);
872 872
873 match = NULL; 873 match = NULL;
874 874
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 3c316c688ade..1f9f5ec07595 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -239,7 +239,7 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
239 int i, j; 239 int i, j;
240 240
241 for (i = 0; i < 4 ; i++) { 241 for (i = 0; i < 4 ; i++) {
242 __u32 a1xora2; 242 __be32 a1xora2;
243 243
244 a1xora2 = a1->s6_addr32[i] ^ a2->s6_addr32[i]; 244 a1xora2 = a1->s6_addr32[i] ^ a2->s6_addr32[i];
245 245
@@ -425,7 +425,7 @@ static int sctp_v6_to_addr_param(const union sctp_addr *addr,
425 int length = sizeof(sctp_ipv6addr_param_t); 425 int length = sizeof(sctp_ipv6addr_param_t);
426 426
427 param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS; 427 param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS;
428 param->v6.param_hdr.length = ntohs(length); 428 param->v6.param_hdr.length = htons(length);
429 ipv6_addr_copy(&param->v6.addr, &addr->v6.sin6_addr); 429 ipv6_addr_copy(&param->v6.addr, &addr->v6.sin6_addr);
430 430
431 return length; 431 return length;
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index c107d45f6e65..4310e7fac443 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -307,7 +307,7 @@ static int sctp_v4_to_addr_param(const union sctp_addr *addr,
307 int length = sizeof(sctp_ipv4addr_param_t); 307 int length = sizeof(sctp_ipv4addr_param_t);
308 308
309 param->v4.param_hdr.type = SCTP_PARAM_IPV4_ADDRESS; 309 param->v4.param_hdr.type = SCTP_PARAM_IPV4_ADDRESS;
310 param->v4.param_hdr.length = ntohs(length); 310 param->v4.param_hdr.length = htons(length);
311 param->v4.addr.s_addr = addr->v4.sin_addr.s_addr; 311 param->v4.addr.s_addr = addr->v4.sin_addr.s_addr;
312 312
313 return length; 313 return length;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index a3bde93bd8a3..ccbba6b24d1d 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1190,7 +1190,7 @@ void sctp_chunk_assign_ssn(struct sctp_chunk *chunk)
1190 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { 1190 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) {
1191 ssn = 0; 1191 ssn = 0;
1192 } else { 1192 } else {
1193 sid = htons(chunk->subh.data_hdr->stream); 1193 sid = ntohs(chunk->subh.data_hdr->stream);
1194 if (chunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG) 1194 if (chunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG)
1195 ssn = sctp_ssn_next(&chunk->asoc->ssnmap->out, sid); 1195 ssn = sctp_ssn_next(&chunk->asoc->ssnmap->out, sid);
1196 else 1196 else
@@ -2230,7 +2230,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
2230 union sctp_addr *laddr, 2230 union sctp_addr *laddr,
2231 struct sockaddr *addrs, 2231 struct sockaddr *addrs,
2232 int addrcnt, 2232 int addrcnt,
2233 __u16 flags) 2233 __be16 flags)
2234{ 2234{
2235 sctp_addip_param_t param; 2235 sctp_addip_param_t param;
2236 struct sctp_chunk *retval; 2236 struct sctp_chunk *retval;
@@ -2364,13 +2364,13 @@ static struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *as
2364 2364
2365/* Add response parameters to an ASCONF_ACK chunk. */ 2365/* Add response parameters to an ASCONF_ACK chunk. */
2366static void sctp_add_asconf_response(struct sctp_chunk *chunk, __u32 crr_id, 2366static void sctp_add_asconf_response(struct sctp_chunk *chunk, __u32 crr_id,
2367 __u16 err_code, sctp_addip_param_t *asconf_param) 2367 __be16 err_code, sctp_addip_param_t *asconf_param)
2368{ 2368{
2369 sctp_addip_param_t ack_param; 2369 sctp_addip_param_t ack_param;
2370 sctp_errhdr_t err_param; 2370 sctp_errhdr_t err_param;
2371 int asconf_param_len = 0; 2371 int asconf_param_len = 0;
2372 int err_param_len = 0; 2372 int err_param_len = 0;
2373 __u16 response_type; 2373 __be16 response_type;
2374 2374
2375 if (SCTP_ERROR_NO_ERROR == err_code) { 2375 if (SCTP_ERROR_NO_ERROR == err_code) {
2376 response_type = SCTP_PARAM_SUCCESS_REPORT; 2376 response_type = SCTP_PARAM_SUCCESS_REPORT;
@@ -2404,7 +2404,7 @@ static void sctp_add_asconf_response(struct sctp_chunk *chunk, __u32 crr_id,
2404} 2404}
2405 2405
2406/* Process a asconf parameter. */ 2406/* Process a asconf parameter. */
2407static __u16 sctp_process_asconf_param(struct sctp_association *asoc, 2407static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2408 struct sctp_chunk *asconf, 2408 struct sctp_chunk *asconf,
2409 sctp_addip_param_t *asconf_param) 2409 sctp_addip_param_t *asconf_param)
2410{ 2410{
@@ -2487,7 +2487,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
2487 sctp_addip_param_t *asconf_param; 2487 sctp_addip_param_t *asconf_param;
2488 struct sctp_chunk *asconf_ack; 2488 struct sctp_chunk *asconf_ack;
2489 2489
2490 __u16 err_code; 2490 __be16 err_code;
2491 int length = 0; 2491 int length = 0;
2492 int chunk_len = asconf->skb->len; 2492 int chunk_len = asconf->skb->len;
2493 __u32 serial; 2493 __u32 serial;
@@ -2630,7 +2630,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2630 * All TLVs after the failed response are considered unsuccessful unless a 2630 * All TLVs after the failed response are considered unsuccessful unless a
2631 * specific success indication is present for the parameter. 2631 * specific success indication is present for the parameter.
2632 */ 2632 */
2633static __u16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack, 2633static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
2634 sctp_addip_param_t *asconf_param, 2634 sctp_addip_param_t *asconf_param,
2635 int no_err) 2635 int no_err)
2636{ 2636{
@@ -2638,7 +2638,7 @@ static __u16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
2638 sctp_errhdr_t *err_param; 2638 sctp_errhdr_t *err_param;
2639 int length; 2639 int length;
2640 int asconf_ack_len = asconf_ack->skb->len; 2640 int asconf_ack_len = asconf_ack->skb->len;
2641 __u16 err_code; 2641 __be16 err_code;
2642 2642
2643 if (no_err) 2643 if (no_err)
2644 err_code = SCTP_ERROR_NO_ERROR; 2644 err_code = SCTP_ERROR_NO_ERROR;
@@ -2694,7 +2694,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
2694 int all_param_pass = 0; 2694 int all_param_pass = 0;
2695 int no_err = 1; 2695 int no_err = 1;
2696 int retval = 0; 2696 int retval = 0;
2697 __u16 err_code = SCTP_ERROR_NO_ERROR; 2697 __be16 err_code = SCTP_ERROR_NO_ERROR;
2698 2698
2699 /* Skip the chunkhdr and addiphdr from the last asconf sent and store 2699 /* Skip the chunkhdr and addiphdr from the last asconf sent and store
2700 * a pointer to address parameter. 2700 * a pointer to address parameter.