[SCTP]: sctp_has_association() switched to net-endian.
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Nov 2006 01:11:50 +0000 (17:11 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:26:50 +0000 (21:26 -0800)
Ditto for its only caller (sctp_endpoint_is_peeled_off)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/endpointola.c
net/sctp/input.c
net/sctp/socket.c

index 5ffb1af336c0180321a35e5fcf8cc1ad7ed68d18..4cca7792c961eecb6accae5ebe03c1d63440a025 100644 (file)
@@ -305,7 +305,7 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
        bp = &ep->base.bind_addr;
        list_for_each(pos, &bp->address_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
-               if (sctp_has_association(&addr->a_h, paddr)) {
+               if (sctp_has_association(&addr->a, paddr)) {
                        sctp_read_unlock(&ep->base.addr_lock);
                        return 1;
                }
index 2d660f8d94fdc19b2b31fff16484a0bf8f8fc187..33111873a488eaf78b63907d73da6ce6ad9cc9fd 100644 (file)
@@ -872,11 +872,8 @@ int sctp_has_association(const union sctp_addr *laddr,
 {
        struct sctp_association *asoc;
        struct sctp_transport *transport;
-       union sctp_addr tmp, tmp2;
-       flip_to_n(&tmp, laddr);
-       flip_to_n(&tmp2, paddr);
 
-       if ((asoc = sctp_lookup_association(&tmp, &tmp2, &transport))) {
+       if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) {
                sctp_association_put(asoc);
                return 1;
        }
index 6beaa7821ca673d072b93d9b756b741c02948f39..e118e3c1285ef13615fb6d5ee9b29ac33604d6e1 100644 (file)
@@ -1018,7 +1018,7 @@ static int __sctp_connect(struct sock* sk,
                 * make sure that there is no peeled-off association matching
                 * the peer address even on another socket.
                 */
-               if (sctp_endpoint_is_peeled_off(ep, &to)) {
+               if (sctp_endpoint_is_peeled_off(ep, sa_addr)) {
                        err = -EADDRNOTAVAIL;
                        goto out_free;
                }
@@ -1475,7 +1475,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
                         */
                        if ((sctp_style(sk, TCP) &&
                             sctp_sstate(sk, ESTABLISHED)) ||
-                           sctp_endpoint_is_peeled_off(ep, &to)) {
+                           sctp_endpoint_is_peeled_off(ep, &tmp)) {
                                err = -EADDRNOTAVAIL;
                                goto out_unlock;
                        }