From 4bdf4b5fe22c26750c39fdd2939a5f33df0cc341 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 20 Nov 2006 17:10:20 -0800 Subject: [SCTP]: Switch sctp_assoc_add_peer() to net-endian. Signed-off-by: Al Viro Signed-off-by: David S. Miller --- net/sctp/associola.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'net/sctp/associola.c') diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 7824aeaa3d6..5b8971be977 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -533,19 +533,17 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, struct sctp_transport *peer; struct sctp_sock *sp; unsigned short port; - union sctp_addr tmp; - flip_to_n(&tmp, addr); sp = sctp_sk(asoc->base.sk); /* AF_INET and AF_INET6 share common port field. */ - port = addr->v4.sin_port; + port = ntohs(addr->v4.sin_port); SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ", " port: %d state:%d\n", asoc, addr, - addr->v4.sin_port, + port, peer_state); /* Set the port if it has not been set yet. */ @@ -553,7 +551,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, asoc->peer.port = port; /* Check to see if this is a duplicate. */ - peer = sctp_assoc_lookup_paddr(asoc, &tmp); + peer = sctp_assoc_lookup_paddr(asoc, addr); if (peer) { if (peer->state == SCTP_UNKNOWN) { if (peer_state == SCTP_ACTIVE) @@ -564,7 +562,7 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, return peer; } - peer = sctp_transport_new(&tmp, gfp); + peer = sctp_transport_new(addr, gfp); if (!peer) return NULL; @@ -1070,7 +1068,7 @@ void sctp_assoc_update(struct sctp_association *asoc, trans = list_entry(pos, struct sctp_transport, transports); if (!sctp_assoc_lookup_paddr(asoc, &trans->ipaddr)) - sctp_assoc_add_peer(asoc, &trans->ipaddr_h, + sctp_assoc_add_peer(asoc, &trans->ipaddr, GFP_ATOMIC, trans->state); } -- cgit v1.2.3-18-g5258