diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-12-20 14:12:59 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:59:24 -0800 |
commit | 75205f478331cc64ce729ea72d3c8c1837fb59cb (patch) | |
tree | 6267006b32ff0756c142e5d4c74755d11696f6c6 /net/sctp/bind_addr.c | |
parent | f57d96b2e92d209ab3991bba9a44e0d6ef7614a8 (diff) | |
download | linux-75205f478331cc64ce729ea72d3c8c1837fb59cb.tar.gz linux-75205f478331cc64ce729ea72d3c8c1837fb59cb.tar.bz2 linux-75205f478331cc64ce729ea72d3c8c1837fb59cb.zip |
[SCTP]: Implement ADD-IP special case processing for ABORT chunk
ADD-IP spec has a special case for processing ABORTs:
F4) ... One special consideration is that ABORT
Chunks arriving destined to the IP address being deleted MUST be
ignored (see Section 5.3.1 for further details).
Check if the address we received on is in the DEL state, and if
so, ignore the ABORT.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r-- | net/sctp/bind_addr.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index 432661174789..13fbfb449a55 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c @@ -353,6 +353,32 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp, return match; } +/* Get the state of the entry in the bind_addr_list */ +int sctp_bind_addr_state(const struct sctp_bind_addr *bp, + const union sctp_addr *addr) +{ + struct sctp_sockaddr_entry *laddr; + struct sctp_af *af; + int state = -1; + + af = sctp_get_af_specific(addr->sa.sa_family); + if (unlikely(!af)) + return state; + + rcu_read_lock(); + list_for_each_entry_rcu(laddr, &bp->address_list, list) { + if (!laddr->valid) + continue; + if (af->cmp_addr(&laddr->a, addr)) { + state = laddr->state; + break; + } + } + rcu_read_unlock(); + + return state; +} + /* Find the first address in the bind address list that is not present in * the addrs packed array. */ |