aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 20:07:48 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:26:39 -0500
commitc9a08505ec0a0260fc94a823c014cc3970f72d25 (patch)
tree6dd02280319ebc659a9a80c05d793d127d49338b
parent63de08f45bb73a445edb482850f4cdccd84def48 (diff)
[SCTP]: Switch sctp_del_bind_addr() to net-endian.
Callers adjusted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/bind_addr.c5
-rw-r--r--net/sctp/sm_make_chunk.c2
-rw-r--r--net/sctp/socket.c17
3 files changed, 7 insertions, 17 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 442d891f68ea..eafdd11152d0 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -181,13 +181,10 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
181{ 181{
182 struct list_head *pos, *temp; 182 struct list_head *pos, *temp;
183 struct sctp_sockaddr_entry *addr; 183 struct sctp_sockaddr_entry *addr;
184 union sctp_addr tmp;
185
186 flip_to_n(&tmp, del_addr);
187 184
188 list_for_each_safe(pos, temp, &bp->address_list) { 185 list_for_each_safe(pos, temp, &bp->address_list) {
189 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 186 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
190 if (sctp_cmp_addr_exact(&addr->a, &tmp)) { 187 if (sctp_cmp_addr_exact(&addr->a, del_addr)) {
191 /* Found the exact match. */ 188 /* Found the exact match. */
192 list_del(pos); 189 list_del(pos);
193 kfree(addr); 190 kfree(addr);
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index cc1b01152c34..cb8cecd85a2e 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2609,7 +2609,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2609 case SCTP_PARAM_DEL_IP: 2609 case SCTP_PARAM_DEL_IP:
2610 sctp_local_bh_disable(); 2610 sctp_local_bh_disable();
2611 sctp_write_lock(&asoc->base.addr_lock); 2611 sctp_write_lock(&asoc->base.addr_lock);
2612 retval = sctp_del_bind_addr(bp, &addr); 2612 retval = sctp_del_bind_addr(bp, &tmp);
2613 sctp_write_unlock(&asoc->base.addr_lock); 2613 sctp_write_unlock(&asoc->base.addr_lock);
2614 sctp_local_bh_enable(); 2614 sctp_local_bh_enable();
2615 list_for_each(pos, &asoc->peer.transport_addr_list) { 2615 list_for_each(pos, &asoc->peer.transport_addr_list) {
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index ffdad8e842ac..f00b03845247 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -607,9 +607,8 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
607 int cnt; 607 int cnt;
608 struct sctp_bind_addr *bp = &ep->base.bind_addr; 608 struct sctp_bind_addr *bp = &ep->base.bind_addr;
609 int retval = 0; 609 int retval = 0;
610 union sctp_addr saveaddr;
611 void *addr_buf; 610 void *addr_buf;
612 struct sockaddr *sa_addr; 611 union sctp_addr *sa_addr;
613 struct sctp_af *af; 612 struct sctp_af *af;
614 613
615 SCTP_DEBUG_PRINTK("sctp_bindx_rem (sk: %p, addrs: %p, addrcnt: %d)\n", 614 SCTP_DEBUG_PRINTK("sctp_bindx_rem (sk: %p, addrs: %p, addrcnt: %d)\n",
@@ -627,19 +626,13 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
627 goto err_bindx_rem; 626 goto err_bindx_rem;
628 } 627 }
629 628
630 /* The list may contain either IPv4 or IPv6 address; 629 sa_addr = (union sctp_addr *)addr_buf;
631 * determine the address length to copy the address to 630 af = sctp_get_af_specific(sa_addr->sa.sa_family);
632 * saveaddr.
633 */
634 sa_addr = (struct sockaddr *)addr_buf;
635 af = sctp_get_af_specific(sa_addr->sa_family);
636 if (!af) { 631 if (!af) {
637 retval = -EINVAL; 632 retval = -EINVAL;
638 goto err_bindx_rem; 633 goto err_bindx_rem;
639 } 634 }
640 memcpy(&saveaddr, sa_addr, af->sockaddr_len); 635 if (sa_addr->v4.sin_port != htons(bp->port)) {
641 saveaddr.v4.sin_port = ntohs(saveaddr.v4.sin_port);
642 if (saveaddr.v4.sin_port != bp->port) {
643 retval = -EINVAL; 636 retval = -EINVAL;
644 goto err_bindx_rem; 637 goto err_bindx_rem;
645 } 638 }
@@ -654,7 +647,7 @@ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
654 sctp_local_bh_disable(); 647 sctp_local_bh_disable();
655 sctp_write_lock(&ep->base.addr_lock); 648 sctp_write_lock(&ep->base.addr_lock);
656 649
657 retval = sctp_del_bind_addr(bp, &saveaddr); 650 retval = sctp_del_bind_addr(bp, sa_addr);
658 651
659 sctp_write_unlock(&ep->base.addr_lock); 652 sctp_write_unlock(&ep->base.addr_lock);
660 sctp_local_bh_enable(); 653 sctp_local_bh_enable();