aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/bind_addr.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 20:04:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:26:29 -0500
commit09ef7fecea40c5e4c0dfe35bed3f0ed8da554cf5 (patch)
treeb293f6aa012265dcb413d7dd6c0b68b1f2676b9f /net/sctp/bind_addr.c
parent30330ee00ce077de9d459c17125573ff618bd7a9 (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/bind_addr.c')
-rw-r--r--net/sctp/bind_addr.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 23b5b664a8a0..b8115cb31ae3 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -77,7 +77,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
77 /* Extract the addresses which are relevant for this scope. */ 77 /* Extract the addresses which are relevant for this scope. */
78 list_for_each(pos, &src->address_list) { 78 list_for_each(pos, &src->address_list) {
79 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 79 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
80 error = sctp_copy_one_addr(dest, &addr->a, scope, 80 error = sctp_copy_one_addr(dest, &addr->a_h, scope,
81 gfp, flags); 81 gfp, flags);
82 if (error < 0) 82 if (error < 0)
83 goto out; 83 goto out;
@@ -91,7 +91,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
91 list_for_each(pos, &src->address_list) { 91 list_for_each(pos, &src->address_list) {
92 addr = list_entry(pos, struct sctp_sockaddr_entry, 92 addr = list_entry(pos, struct sctp_sockaddr_entry,
93 list); 93 list);
94 error = sctp_copy_one_addr(dest, &addr->a, 94 error = sctp_copy_one_addr(dest, &addr->a_h,
95 SCTP_SCOPE_LINK, gfp, 95 SCTP_SCOPE_LINK, gfp,
96 flags); 96 flags);
97 if (error < 0) 97 if (error < 0)
@@ -155,13 +155,13 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
155 if (!addr) 155 if (!addr)
156 return -ENOMEM; 156 return -ENOMEM;
157 157
158 memcpy(&addr->a, new, sizeof(*new)); 158 memcpy(&addr->a_h, new, sizeof(*new));
159 159
160 /* Fix up the port if it has not yet been set. 160 /* Fix up the port if it has not yet been set.
161 * Both v4 and v6 have the port at the same offset. 161 * Both v4 and v6 have the port at the same offset.
162 */ 162 */
163 if (!addr->a.v4.sin_port) 163 if (!addr->a_h.v4.sin_port)
164 addr->a.v4.sin_port = bp->port; 164 addr->a_h.v4.sin_port = bp->port;
165 165
166 addr->use_as_src = use_as_src; 166 addr->use_as_src = use_as_src;
167 167
@@ -182,7 +182,7 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
182 182
183 list_for_each_safe(pos, temp, &bp->address_list) { 183 list_for_each_safe(pos, temp, &bp->address_list) {
184 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 184 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
185 if (sctp_cmp_addr_exact(&addr->a, del_addr)) { 185 if (sctp_cmp_addr_exact(&addr->a_h, del_addr)) {
186 /* Found the exact match. */ 186 /* Found the exact match. */
187 list_del(pos); 187 list_del(pos);
188 kfree(addr); 188 kfree(addr);
@@ -237,8 +237,8 @@ union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
237 237
238 list_for_each(pos, &bp->address_list) { 238 list_for_each(pos, &bp->address_list) {
239 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 239 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
240 af = sctp_get_af_specific(addr->a.v4.sin_family); 240 af = sctp_get_af_specific(addr->a_h.v4.sin_family);
241 len = af->to_addr_param(&addr->a, &rawaddr); 241 len = af->to_addr_param(&addr->a_h, &rawaddr);
242 memcpy(addrparms.v, &rawaddr, len); 242 memcpy(addrparms.v, &rawaddr, len);
243 addrparms.v += len; 243 addrparms.v += len;
244 addrparms_len += len; 244 addrparms_len += len;
@@ -305,7 +305,7 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
305 305
306 list_for_each(pos, &bp->address_list) { 306 list_for_each(pos, &bp->address_list) {
307 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 307 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
308 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) 308 if (opt->pf->cmp_addr(&laddr->a_h, addr, opt))
309 return 1; 309 return 1;
310 } 310 }
311 311
@@ -339,13 +339,13 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
339 return NULL; 339 return NULL;
340 flip_to_h(&tmp, addr); 340 flip_to_h(&tmp, addr);
341 341
342 if (opt->pf->cmp_addr(&laddr->a, &tmp, opt)) 342 if (opt->pf->cmp_addr(&laddr->a_h, &tmp, opt))
343 break; 343 break;
344 344
345 addr_buf += af->sockaddr_len; 345 addr_buf += af->sockaddr_len;
346 } 346 }
347 if (i == addrcnt) 347 if (i == addrcnt)
348 return &laddr->a; 348 return &laddr->a_h;
349 } 349 }
350 350
351 return NULL; 351 return NULL;