|
@@ -209,6 +209,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
|
|
int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
|
|
int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
|
|
{
|
|
{
|
|
struct sctp_sockaddr_entry *addr, *temp;
|
|
struct sctp_sockaddr_entry *addr, *temp;
|
|
|
|
+ int found = 0;
|
|
|
|
|
|
/* We hold the socket lock when calling this function,
|
|
/* We hold the socket lock when calling this function,
|
|
* and that acts as a writer synchronizing lock.
|
|
* and that acts as a writer synchronizing lock.
|
|
@@ -216,13 +217,14 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
|
|
list_for_each_entry_safe(addr, temp, &bp->address_list, list) {
|
|
list_for_each_entry_safe(addr, temp, &bp->address_list, list) {
|
|
if (sctp_cmp_addr_exact(&addr->a, del_addr)) {
|
|
if (sctp_cmp_addr_exact(&addr->a, del_addr)) {
|
|
/* Found the exact match. */
|
|
/* Found the exact match. */
|
|
|
|
+ found = 1;
|
|
addr->valid = 0;
|
|
addr->valid = 0;
|
|
list_del_rcu(&addr->list);
|
|
list_del_rcu(&addr->list);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (addr && !addr->valid) {
|
|
|
|
|
|
+ if (found) {
|
|
call_rcu(&addr->rcu, sctp_local_addr_free);
|
|
call_rcu(&addr->rcu, sctp_local_addr_free);
|
|
SCTP_DBG_OBJCNT_DEC(addr);
|
|
SCTP_DBG_OBJCNT_DEC(addr);
|
|
return 0;
|
|
return 0;
|