diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 20:04:10 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:26:29 -0500 |
commit | 09ef7fecea40c5e4c0dfe35bed3f0ed8da554cf5 (patch) | |
tree | b293f6aa012265dcb413d7dd6c0b68b1f2676b9f /net/sctp/protocol.c | |
parent | 30330ee00ce077de9d459c17125573ff618bd7a9 (diff) |
[SCTP]: Beginning of conversion to net-endian for embedded sctp_addr.
Part 1: rename sctp_chunk->source, sctp_sockaddr_entry->a,
sctp_transport->ipaddr and sctp_transport->saddr (to ..._h)
The next patch will reintroduce these fields and keep them as
net-endian mirrors of the original (renamed) ones. Split in
two patches to make sure that we hadn't forgotten any instanes.
Later in the series we'll eliminate uses of host-endian variants
(basically switching users to net-endian counterparts as we
progress through that mess). Then host-endian ones will die.
Other embedded host-endian sctp_addr will be easier to switch
directly, so we leave them alone for now.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 4310e7fac443..20883ffd51d9 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -150,9 +150,9 @@ static void sctp_v4_copy_addrlist(struct list_head *addrlist, | |||
150 | /* Add the address to the local list. */ | 150 | /* Add the address to the local list. */ |
151 | addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); | 151 | addr = t_new(struct sctp_sockaddr_entry, GFP_ATOMIC); |
152 | if (addr) { | 152 | if (addr) { |
153 | addr->a.v4.sin_family = AF_INET; | 153 | addr->a_h.v4.sin_family = AF_INET; |
154 | addr->a.v4.sin_port = 0; | 154 | addr->a_h.v4.sin_port = 0; |
155 | addr->a.v4.sin_addr.s_addr = ifa->ifa_local; | 155 | addr->a_h.v4.sin_addr.s_addr = ifa->ifa_local; |
156 | list_add_tail(&addr->list, addrlist); | 156 | list_add_tail(&addr->list, addrlist); |
157 | } | 157 | } |
158 | } | 158 | } |
@@ -223,17 +223,17 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope, | |||
223 | sctp_spin_lock_irqsave(&sctp_local_addr_lock, flags); | 223 | sctp_spin_lock_irqsave(&sctp_local_addr_lock, flags); |
224 | list_for_each(pos, &sctp_local_addr_list) { | 224 | list_for_each(pos, &sctp_local_addr_list) { |
225 | addr = list_entry(pos, struct sctp_sockaddr_entry, list); | 225 | addr = list_entry(pos, struct sctp_sockaddr_entry, list); |
226 | if (sctp_in_scope(&addr->a, scope)) { | 226 | if (sctp_in_scope(&addr->a_h, scope)) { |
227 | /* Now that the address is in scope, check to see if | 227 | /* Now that the address is in scope, check to see if |
228 | * the address type is really supported by the local | 228 | * the address type is really supported by the local |
229 | * sock as well as the remote peer. | 229 | * sock as well as the remote peer. |
230 | */ | 230 | */ |
231 | if ((((AF_INET == addr->a.sa.sa_family) && | 231 | if ((((AF_INET == addr->a_h.sa.sa_family) && |
232 | (copy_flags & SCTP_ADDR4_PEERSUPP))) || | 232 | (copy_flags & SCTP_ADDR4_PEERSUPP))) || |
233 | (((AF_INET6 == addr->a.sa.sa_family) && | 233 | (((AF_INET6 == addr->a_h.sa.sa_family) && |
234 | (copy_flags & SCTP_ADDR6_ALLOWED) && | 234 | (copy_flags & SCTP_ADDR6_ALLOWED) && |
235 | (copy_flags & SCTP_ADDR6_PEERSUPP)))) { | 235 | (copy_flags & SCTP_ADDR6_PEERSUPP)))) { |
236 | error = sctp_add_bind_addr(bp, &addr->a, 1, | 236 | error = sctp_add_bind_addr(bp, &addr->a_h, 1, |
237 | GFP_ATOMIC); | 237 | GFP_ATOMIC); |
238 | if (error) | 238 | if (error) |
239 | goto end_copy; | 239 | goto end_copy; |
@@ -482,7 +482,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
482 | if (!laddr->use_as_src) | 482 | if (!laddr->use_as_src) |
483 | continue; | 483 | continue; |
484 | sctp_v4_dst_saddr(&dst_saddr, dst, bp->port); | 484 | sctp_v4_dst_saddr(&dst_saddr, dst, bp->port); |
485 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) | 485 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a_h)) |
486 | goto out_unlock; | 486 | goto out_unlock; |
487 | } | 487 | } |
488 | sctp_read_unlock(addr_lock); | 488 | sctp_read_unlock(addr_lock); |
@@ -502,8 +502,8 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
502 | laddr = list_entry(pos, struct sctp_sockaddr_entry, list); | 502 | laddr = list_entry(pos, struct sctp_sockaddr_entry, list); |
503 | 503 | ||
504 | if ((laddr->use_as_src) && | 504 | if ((laddr->use_as_src) && |
505 | (AF_INET == laddr->a.sa.sa_family)) { | 505 | (AF_INET == laddr->a_h.sa.sa_family)) { |
506 | fl.fl4_src = laddr->a.v4.sin_addr.s_addr; | 506 | fl.fl4_src = laddr->a_h.v4.sin_addr.s_addr; |
507 | if (!ip_route_output_key(&rt, &fl)) { | 507 | if (!ip_route_output_key(&rt, &fl)) { |
508 | dst = &rt->u.dst; | 508 | dst = &rt->u.dst; |
509 | goto out_unlock; | 509 | goto out_unlock; |