diff options
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/input.c | 2 | ||||
-rw-r--r-- | net/sctp/protocol.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 57fe2f81eca8..812ff1756c3e 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -944,7 +944,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb, | |||
944 | static struct sctp_association *__sctp_rcv_asconf_lookup( | 944 | static struct sctp_association *__sctp_rcv_asconf_lookup( |
945 | sctp_chunkhdr_t *ch, | 945 | sctp_chunkhdr_t *ch, |
946 | const union sctp_addr *laddr, | 946 | const union sctp_addr *laddr, |
947 | __be32 peer_port, | 947 | __be16 peer_port, |
948 | struct sctp_transport **transportp) | 948 | struct sctp_transport **transportp) |
949 | { | 949 | { |
950 | sctp_addip_chunk_t *asconf = (struct sctp_addip_chunk *)ch; | 950 | sctp_addip_chunk_t *asconf = (struct sctp_addip_chunk *)ch; |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index ad0a4069b95b..7a7646a9565c 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -337,14 +337,14 @@ static int sctp_v4_cmp_addr(const union sctp_addr *addr1, | |||
337 | static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port) | 337 | static void sctp_v4_inaddr_any(union sctp_addr *addr, __be16 port) |
338 | { | 338 | { |
339 | addr->v4.sin_family = AF_INET; | 339 | addr->v4.sin_family = AF_INET; |
340 | addr->v4.sin_addr.s_addr = INADDR_ANY; | 340 | addr->v4.sin_addr.s_addr = htonl(INADDR_ANY); |
341 | addr->v4.sin_port = port; | 341 | addr->v4.sin_port = port; |
342 | } | 342 | } |
343 | 343 | ||
344 | /* Is this a wildcard address? */ | 344 | /* Is this a wildcard address? */ |
345 | static int sctp_v4_is_any(const union sctp_addr *addr) | 345 | static int sctp_v4_is_any(const union sctp_addr *addr) |
346 | { | 346 | { |
347 | return INADDR_ANY == addr->v4.sin_addr.s_addr; | 347 | return htonl(INADDR_ANY) == addr->v4.sin_addr.s_addr; |
348 | } | 348 | } |
349 | 349 | ||
350 | /* This function checks if the address is a valid address to be used for | 350 | /* This function checks if the address is a valid address to be used for |
@@ -375,7 +375,7 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp) | |||
375 | int ret = inet_addr_type(&init_net, addr->v4.sin_addr.s_addr); | 375 | int ret = inet_addr_type(&init_net, addr->v4.sin_addr.s_addr); |
376 | 376 | ||
377 | 377 | ||
378 | if (addr->v4.sin_addr.s_addr != INADDR_ANY && | 378 | if (addr->v4.sin_addr.s_addr != htonl(INADDR_ANY) && |
379 | ret != RTN_LOCAL && | 379 | ret != RTN_LOCAL && |
380 | !sp->inet.freebind && | 380 | !sp->inet.freebind && |
381 | !sysctl_ip_nonlocal_bind) | 381 | !sysctl_ip_nonlocal_bind) |
@@ -785,8 +785,8 @@ static int sctp_inet_cmp_addr(const union sctp_addr *addr1, | |||
785 | /* PF_INET only supports AF_INET addresses. */ | 785 | /* PF_INET only supports AF_INET addresses. */ |
786 | if (addr1->sa.sa_family != addr2->sa.sa_family) | 786 | if (addr1->sa.sa_family != addr2->sa.sa_family) |
787 | return 0; | 787 | return 0; |
788 | if (INADDR_ANY == addr1->v4.sin_addr.s_addr || | 788 | if (htonl(INADDR_ANY) == addr1->v4.sin_addr.s_addr || |
789 | INADDR_ANY == addr2->v4.sin_addr.s_addr) | 789 | htonl(INADDR_ANY) == addr2->v4.sin_addr.s_addr) |
790 | return 1; | 790 | return 1; |
791 | if (addr1->v4.sin_addr.s_addr == addr2->v4.sin_addr.s_addr) | 791 | if (addr1->v4.sin_addr.s_addr == addr2->v4.sin_addr.s_addr) |
792 | return 1; | 792 | return 1; |