]> err.no Git - linux-2.6/commitdiff
[SCTP]: Trivial parts of a_h -> a switch.
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Nov 2006 01:21:44 +0000 (17:21 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:26:58 +0000 (21:26 -0800)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/bind_addr.c
net/sctp/ipv6.c
net/sctp/protocol.c
net/sctp/socket.c

index 50f3697625fda943909e79df63d0e7a25cb02b01..f201df66180d0842a231a0b2a567ed549dd587ae 100644 (file)
@@ -239,8 +239,8 @@ union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
 
        list_for_each(pos, &bp->address_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
-               af = sctp_get_af_specific(addr->a_h.v4.sin_family);
-               len = af->to_addr_param(&addr->a_h, &rawaddr);
+               af = sctp_get_af_specific(addr->a.v4.sin_family);
+               len = af->to_addr_param(&addr->a, &rawaddr);
                memcpy(addrparms.v, &rawaddr, len);
                addrparms.v += len;
                addrparms_len += len;
index 3dc8ed14352123f0f627a58b90ad4641a5d11f23..b3fa426bd1dc4a292ac6bc0eff1a45fc639f4bcf 100644 (file)
@@ -290,8 +290,8 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
        list_for_each(pos, &bp->address_list) {
                laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
                if ((laddr->use_as_src) &&
-                   (laddr->a_h.sa.sa_family == AF_INET6) &&
-                   (scope <= sctp_scope(&laddr->a_h))) {
+                   (laddr->a.sa.sa_family == AF_INET6) &&
+                   (scope <= sctp_scope(&laddr->a))) {
                        bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
                        if (!baddr || (matchlen < bmatchlen)) {
                                baddr = &laddr->a;
index 5b8b7f3598e09f1ce200de50050548f9304bf47a..c20f05b3308fca4260ce2c7466ce94059b4eaa16 100644 (file)
@@ -224,14 +224,14 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope,
        sctp_spin_lock_irqsave(&sctp_local_addr_lock, flags);
        list_for_each(pos, &sctp_local_addr_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
-               if (sctp_in_scope(&addr->a_h, scope)) {
+               if (sctp_in_scope(&addr->a, scope)) {
                        /* Now that the address is in scope, check to see if
                         * the address type is really supported by the local
                         * sock as well as the remote peer.
                         */
-                       if ((((AF_INET == addr->a_h.sa.sa_family) &&
+                       if ((((AF_INET == addr->a.sa.sa_family) &&
                              (copy_flags & SCTP_ADDR4_PEERSUPP))) ||
-                           (((AF_INET6 == addr->a_h.sa.sa_family) &&
+                           (((AF_INET6 == addr->a.sa.sa_family) &&
                              (copy_flags & SCTP_ADDR6_ALLOWED) &&
                              (copy_flags & SCTP_ADDR6_PEERSUPP)))) {
                                error = sctp_add_bind_addr(bp, &addr->a, 1,
@@ -503,8 +503,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
                laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
 
                if ((laddr->use_as_src) &&
-                   (AF_INET == laddr->a_h.sa.sa_family)) {
-                       fl.fl4_src = laddr->a_h.v4.sin_addr.s_addr;
+                   (AF_INET == laddr->a.sa.sa_family)) {
+                       fl.fl4_src = laddr->a.v4.sin_addr.s_addr;
                        if (!ip_route_output_key(&rt, &fl)) {
                                dst = &rt->u.dst;
                                goto out_unlock;
index e118e3c1285ef13615fb6d5ee9b29ac33604d6e1..a3e1ca2c3cb7405c4e2f6e086e80dfad4326cb57 100644 (file)
@@ -3867,14 +3867,14 @@ static int sctp_getsockopt_local_addrs_num_old(struct sock *sk, int len,
        if (sctp_list_single_entry(&bp->address_list)) {
                addr = list_entry(bp->address_list.next,
                                  struct sctp_sockaddr_entry, list);
-               if (sctp_is_any(&addr->a_h)) {
+               if (sctp_is_any(&addr->a)) {
                        sctp_spin_lock_irqsave(&sctp_local_addr_lock, flags);
                        list_for_each(pos, &sctp_local_addr_list) {
                                addr = list_entry(pos,
                                                  struct sctp_sockaddr_entry,
                                                  list);
                                if ((PF_INET == sk->sk_family) && 
-                                   (AF_INET6 == addr->a_h.sa.sa_family))
+                                   (AF_INET6 == addr->a.sa.sa_family))
                                        continue;
                                cnt++;
                        }
@@ -3912,13 +3912,12 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add
        list_for_each(pos, &sctp_local_addr_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
                if ((PF_INET == sk->sk_family) && 
-                   (AF_INET6 == addr->a_h.sa.sa_family))
+                   (AF_INET6 == addr->a.sa.sa_family))
                        continue;
-               memcpy(&temp, &addr->a_h, sizeof(temp));
+               memcpy(&temp, &addr->a, sizeof(temp));
                sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk),
                                                                &temp);
                addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
-               temp.v4.sin_port = htons(port);
                if (copy_to_user(to, &temp, addrlen)) {
                        sctp_spin_unlock_irqrestore(&sctp_local_addr_lock,
                                                    flags);
@@ -3947,15 +3946,14 @@ static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port,
        list_for_each(pos, &sctp_local_addr_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
                if ((PF_INET == sk->sk_family) && 
-                   (AF_INET6 == addr->a_h.sa.sa_family))
+                   (AF_INET6 == addr->a.sa.sa_family))
                        continue;
-               memcpy(&temp, &addr->a_h, sizeof(temp));
+               memcpy(&temp, &addr->a, sizeof(temp));
                sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk),
                                                                &temp);
                addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
                if(space_left<addrlen)
                        return -ENOMEM;
-               temp.v4.sin_port = htons(port);
                if (copy_to_user(*to, &temp, addrlen)) {
                        sctp_spin_unlock_irqrestore(&sctp_local_addr_lock,
                                                    flags);
@@ -4023,7 +4021,7 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
        if (sctp_list_single_entry(&bp->address_list)) {
                addr = list_entry(bp->address_list.next,
                                  struct sctp_sockaddr_entry, list);
-               if (sctp_is_any(&addr->a_h)) {
+               if (sctp_is_any(&addr->a)) {
                        cnt = sctp_copy_laddrs_to_user_old(sk, bp->port,
                                                           getaddrs.addr_num,
                                                           to);
@@ -4037,10 +4035,9 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
 
        list_for_each(pos, &bp->address_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
-               memcpy(&temp, &addr->a_h, sizeof(temp));
+               memcpy(&temp, &addr->a, sizeof(temp));
                sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp);
                addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
-               temp.v4.sin_port = htons(temp.v4.sin_port);
                if (copy_to_user(to, &temp, addrlen)) {
                        err = -EFAULT;
                        goto unlock;
@@ -4113,7 +4110,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
        if (sctp_list_single_entry(&bp->address_list)) {
                addr = list_entry(bp->address_list.next,
                                  struct sctp_sockaddr_entry, list);
-               if (sctp_is_any(&addr->a_h)) {
+               if (sctp_is_any(&addr->a)) {
                        cnt = sctp_copy_laddrs_to_user(sk, bp->port,
                                                       &to, space_left);
                        if (cnt < 0) {
@@ -4126,12 +4123,11 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
 
        list_for_each(pos, &bp->address_list) {
                addr = list_entry(pos, struct sctp_sockaddr_entry, list);
-               memcpy(&temp, &addr->a_h, sizeof(temp));
+               memcpy(&temp, &addr->a, sizeof(temp));
                sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp);
                addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
                if(space_left < addrlen)
                        return -ENOMEM; /*fixme: right error?*/
-               temp.v4.sin_port = htons(temp.v4.sin_port);
                if (copy_to_user(to, &temp, addrlen)) {
                        err = -EFAULT;
                        goto unlock;