summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 17:11:33 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:26:49 -0800
commitcd4ff034e3572679f7ff8f126469b3addd1a4fbc (patch)
tree04fa32f4cfd96cdc81f8df3265ed36644a3e563f /net/sctp
parentdd86d136f9feb72c52a5b07707affe80edbc8dda (diff)
downloadop-kernel-dev-cd4ff034e3572679f7ff8f126469b3addd1a4fbc.zip
op-kernel-dev-cd4ff034e3572679f7ff8f126469b3addd1a4fbc.tar.gz
[SCTP]: sctp_endpoint_lookup_assoc() switched 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')
-rw-r--r--net/sctp/endpointola.c10
-rw-r--r--net/sctp/socket.c8
2 files changed, 8 insertions, 10 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index c543f32..5ffb1af 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -257,16 +257,14 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
int rport;
struct sctp_association *asoc;
struct list_head *pos;
- union sctp_addr tmp;
- flip_to_n(&tmp, paddr);
- rport = paddr->v4.sin_port;
+ rport = ntohs(paddr->v4.sin_port);
list_for_each(pos, &ep->asocs) {
asoc = list_entry(pos, struct sctp_association, asocs);
if (rport == asoc->peer.port) {
sctp_read_lock(&asoc->base.addr_lock);
- *transport = sctp_assoc_lookup_paddr(asoc, &tmp);
+ *transport = sctp_assoc_lookup_paddr(asoc, paddr);
sctp_read_unlock(&asoc->base.addr_lock);
if (*transport)
@@ -348,8 +346,10 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep)
* COOKIE-ECHO chunk.
*/
if (NULL == chunk->asoc) {
+ union sctp_addr tmp;
+ flip_to_n(&tmp, sctp_source(chunk));
asoc = sctp_endpoint_lookup_assoc(ep,
- sctp_source(chunk),
+ &tmp,
&transport);
chunk->asoc = asoc;
chunk->transport = transport;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d09589a..6beaa78 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -228,11 +228,9 @@ static struct sctp_transport *sctp_addr_id2transport(struct sock *sk,
struct sctp_association *addr_asoc = NULL, *id_asoc = NULL;
struct sctp_transport *transport;
union sctp_addr *laddr = (union sctp_addr *)addr;
- union sctp_addr tmp;
- flip_to_h(&tmp, laddr);
addr_asoc = sctp_endpoint_lookup_assoc(sctp_sk(sk)->ep,
- &tmp,
+ laddr,
&transport);
if (!addr_asoc)
@@ -1007,7 +1005,7 @@ static int __sctp_connect(struct sock* sk,
/* Check if there already is a matching association on the
* endpoint (other than the one created here).
*/
- asoc2 = sctp_endpoint_lookup_assoc(ep, &to, &transport);
+ asoc2 = sctp_endpoint_lookup_assoc(ep, sa_addr, &transport);
if (asoc2 && asoc2 != asoc) {
if (asoc2->state >= SCTP_STATE_ESTABLISHED)
err = -EISCONN;
@@ -1468,7 +1466,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
/* If a msg_name has been specified, assume this is to be used. */
if (msg_name) {
/* Look for a matching association on the endpoint. */
- asoc = sctp_endpoint_lookup_assoc(ep, &to, &transport);
+ asoc = sctp_endpoint_lookup_assoc(ep, &tmp, &transport);
if (!asoc) {
/* If we could not find a matching association on the
* endpoint, make sure that it is not a TCP-style
OpenPOWER on IntegriCloud