summaryrefslogtreecommitdiff
path: root/net/sctp/bind_addr.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-21 04:05:23 +0300
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 08:26:32 +0300
commit5f242a13e8505e0f3efd3113da6e029f6e7dfa32 (patch)
tree5c9a7de99887bde11fd16e1bfaf2543b358f8727 /net/sctp/bind_addr.c
parentc604e368a477ed1f7dd532605a8f1990d2b128ee (diff)
downloadlinux-5f242a13e8505e0f3efd3113da6e029f6e7dfa32.tar.xz
[SCTP]: Switch ->cmp_addr() and sctp_cmp_addr_exact() to net-endian.
instances of ->cmp_addr() are fine with switching both arguments to net-endian; callers other than in sctp_cmp_addr_exact() (both as ->cmp_addr(...) and direct calls of instances) adjusted; sctp_cmp_addr_exact() switched to net-endian itself and adjustment is done in its callers 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.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 2b36e4238170..9085e531d575 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -181,10 +181,13 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
{
struct list_head *pos, *temp;
struct sctp_sockaddr_entry *addr;
+ union sctp_addr tmp;
+
+ flip_to_n(&tmp, del_addr);
list_for_each_safe(pos, temp, &bp->address_list) {
addr = list_entry(pos, struct sctp_sockaddr_entry, list);
- if (sctp_cmp_addr_exact(&addr->a_h, del_addr)) {
+ if (sctp_cmp_addr_exact(&addr->a, &tmp)) {
/* Found the exact match. */
list_del(pos);
kfree(addr);
@@ -304,10 +307,12 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
{
struct sctp_sockaddr_entry *laddr;
struct list_head *pos;
+ union sctp_addr tmp;
+ flip_to_n(&tmp, addr);
list_for_each(pos, &bp->address_list) {
laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
- if (opt->pf->cmp_addr(&laddr->a_h, addr, opt))
+ if (opt->pf->cmp_addr(&laddr->a, &tmp, opt))
return 1;
}
@@ -334,14 +339,12 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
addr_buf = (union sctp_addr *)addrs;
for (i = 0; i < addrcnt; i++) {
- union sctp_addr tmp;
addr = (union sctp_addr *)addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
if (!af)
return NULL;
- flip_to_h(&tmp, addr);
- if (opt->pf->cmp_addr(&laddr->a_h, &tmp, opt))
+ if (opt->pf->cmp_addr(&laddr->a, addr, opt))
break;
addr_buf += af->sockaddr_len;