diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-12-20 17:12:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:59:24 -0500 |
commit | f57d96b2e92d209ab3991bba9a44e0d6ef7614a8 (patch) | |
tree | bfd82e031bd1842d0efc60beb893947d9ee95ccc /net/sctp/protocol.c | |
parent | a08de64d074b36a56ee3bb985cd171281db78e96 (diff) |
[SCTP]: Change use_as_src into a full address state
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index dc22d7108494..e466e00b9a9f 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -229,8 +229,8 @@ int sctp_copy_local_addr_list(struct sctp_bind_addr *bp, sctp_scope_t scope, | |||
229 | (((AF_INET6 == addr->a.sa.sa_family) && | 229 | (((AF_INET6 == addr->a.sa.sa_family) && |
230 | (copy_flags & SCTP_ADDR6_ALLOWED) && | 230 | (copy_flags & SCTP_ADDR6_ALLOWED) && |
231 | (copy_flags & SCTP_ADDR6_PEERSUPP)))) { | 231 | (copy_flags & SCTP_ADDR6_PEERSUPP)))) { |
232 | error = sctp_add_bind_addr(bp, &addr->a, 1, | 232 | error = sctp_add_bind_addr(bp, &addr->a, |
233 | GFP_ATOMIC); | 233 | SCTP_ADDR_SRC, GFP_ATOMIC); |
234 | if (error) | 234 | if (error) |
235 | goto end_copy; | 235 | goto end_copy; |
236 | } | 236 | } |
@@ -472,7 +472,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
472 | */ | 472 | */ |
473 | rcu_read_lock(); | 473 | rcu_read_lock(); |
474 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { | 474 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { |
475 | if (!laddr->valid || !laddr->use_as_src) | 475 | if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) |
476 | continue; | 476 | continue; |
477 | sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); | 477 | sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); |
478 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) | 478 | if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) |
@@ -494,7 +494,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, | |||
494 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { | 494 | list_for_each_entry_rcu(laddr, &bp->address_list, list) { |
495 | if (!laddr->valid) | 495 | if (!laddr->valid) |
496 | continue; | 496 | continue; |
497 | if ((laddr->use_as_src) && | 497 | if ((laddr->state == SCTP_ADDR_SRC) && |
498 | (AF_INET == laddr->a.sa.sa_family)) { | 498 | (AF_INET == laddr->a.sa.sa_family)) { |
499 | fl.fl4_src = laddr->a.v4.sin_addr.s_addr; | 499 | fl.fl4_src = laddr->a.v4.sin_addr.s_addr; |
500 | if (!ip_route_output_key(&rt, &fl)) { | 500 | if (!ip_route_output_key(&rt, &fl)) { |