aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 20:05:43 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:26:33 -0500
commit7e1e4a2b9dcc63ac3328f786f9d98bde90c8fc6c (patch)
treef11e2136bfd2af23399b173ddb47ea8d005289fa
parent5f242a13e8505e0f3efd3113da6e029f6e7dfa32 (diff)
[SCTP]: Switch sctp_bind_addr_match() to net-endian.
Callers adjusted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/associola.c8
-rw-r--r--net/sctp/bind_addr.c4
-rw-r--r--net/sctp/endpointola.c4
-rw-r--r--net/sctp/socket.c4
4 files changed, 9 insertions, 11 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 72199d149573..8d841f16dcbd 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -930,6 +930,8 @@ struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,
930 const union sctp_addr *paddr) 930 const union sctp_addr *paddr)
931{ 931{
932 struct sctp_transport *transport; 932 struct sctp_transport *transport;
933 union sctp_addr tmp;
934 flip_to_n(&tmp, laddr);
933 935
934 sctp_read_lock(&asoc->base.addr_lock); 936 sctp_read_lock(&asoc->base.addr_lock);
935 937
@@ -939,7 +941,7 @@ struct sctp_transport *sctp_assoc_is_match(struct sctp_association *asoc,
939 if (!transport) 941 if (!transport)
940 goto out; 942 goto out;
941 943
942 if (sctp_bind_addr_match(&asoc->base.bind_addr, laddr, 944 if (sctp_bind_addr_match(&asoc->base.bind_addr, &tmp,
943 sctp_sk(asoc->base.sk))) 945 sctp_sk(asoc->base.sk)))
944 goto out; 946 goto out;
945 } 947 }
@@ -1342,12 +1344,10 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc,
1342 const union sctp_addr *laddr) 1344 const union sctp_addr *laddr)
1343{ 1345{
1344 int found; 1346 int found;
1345 union sctp_addr tmp;
1346 1347
1347 flip_to_h(&tmp, laddr);
1348 sctp_read_lock(&asoc->base.addr_lock); 1348 sctp_read_lock(&asoc->base.addr_lock);
1349 if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) && 1349 if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) &&
1350 sctp_bind_addr_match(&asoc->base.bind_addr, &tmp, 1350 sctp_bind_addr_match(&asoc->base.bind_addr, laddr,
1351 sctp_sk(asoc->base.sk))) { 1351 sctp_sk(asoc->base.sk))) {
1352 found = 1; 1352 found = 1;
1353 goto out; 1353 goto out;
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 9085e531d575..442d891f68ea 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -307,12 +307,10 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
307{ 307{
308 struct sctp_sockaddr_entry *laddr; 308 struct sctp_sockaddr_entry *laddr;
309 struct list_head *pos; 309 struct list_head *pos;
310 union sctp_addr tmp;
311 310
312 flip_to_n(&tmp, addr);
313 list_for_each(pos, &bp->address_list) { 311 list_for_each(pos, &bp->address_list) {
314 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 312 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
315 if (opt->pf->cmp_addr(&laddr->a, &tmp, opt)) 313 if (opt->pf->cmp_addr(&laddr->a, addr, opt))
316 return 1; 314 return 1;
317 } 315 }
318 316
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 75904b037ec6..d77fe9232dd1 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -228,10 +228,12 @@ struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *ep,
228 const union sctp_addr *laddr) 228 const union sctp_addr *laddr)
229{ 229{
230 struct sctp_endpoint *retval; 230 struct sctp_endpoint *retval;
231 union sctp_addr tmp;
232 flip_to_n(&tmp, laddr);
231 233
232 sctp_read_lock(&ep->base.addr_lock); 234 sctp_read_lock(&ep->base.addr_lock);
233 if (ep->base.bind_addr.port == laddr->v4.sin_port) { 235 if (ep->base.bind_addr.port == laddr->v4.sin_port) {
234 if (sctp_bind_addr_match(&ep->base.bind_addr, laddr, 236 if (sctp_bind_addr_match(&ep->base.bind_addr, &tmp,
235 sctp_sk(ep->base.sk))) { 237 sctp_sk(ep->base.sk))) {
236 retval = ep; 238 retval = ep;
237 goto out; 239 goto out;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index e03ba9055eb1..d42953efa355 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4635,11 +4635,9 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
4635{ 4635{
4636 struct sctp_bind_hashbucket *head; /* hash list */ 4636 struct sctp_bind_hashbucket *head; /* hash list */
4637 struct sctp_bind_bucket *pp; /* hash list port iterator */ 4637 struct sctp_bind_bucket *pp; /* hash list port iterator */
4638 union sctp_addr tmp;
4639 unsigned short snum; 4638 unsigned short snum;
4640 int ret; 4639 int ret;
4641 4640
4642 flip_to_h(&tmp, addr);
4643 snum = ntohs(addr->v4.sin_port); 4641 snum = ntohs(addr->v4.sin_port);
4644 4642
4645 SCTP_DEBUG_PRINTK("sctp_get_port() begins, snum=%d\n", snum); 4643 SCTP_DEBUG_PRINTK("sctp_get_port() begins, snum=%d\n", snum);
@@ -4737,7 +4735,7 @@ pp_found:
4737 if (reuse && sk2->sk_reuse) 4735 if (reuse && sk2->sk_reuse)
4738 continue; 4736 continue;
4739 4737
4740 if (sctp_bind_addr_match(&ep2->base.bind_addr, &tmp, 4738 if (sctp_bind_addr_match(&ep2->base.bind_addr, addr,
4741 sctp_sk(sk))) { 4739 sctp_sk(sk))) {
4742 ret = (long)sk2; 4740 ret = (long)sk2;
4743 goto fail_unlock; 4741 goto fail_unlock;