aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2011-04-18 15:15:22 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-20 00:45:22 -0400
commitc6ef006bf57fb6a8a0b134928b5c5606090ef0a0 (patch)
tree75edcd54d0d475cb1c3a21e06422c333b5a0096f /net/sctp/sm_make_chunk.c
parentee9cbaca7d73ea0098f00ecd10fe6e4a4792e32c (diff)
sctp: Release all routes when processing acks ADD_IP or DEL_IP
When processing an ACK for ADD_IP parameter, we only release the routes on non-active transports. This can cause a wrong source address to be used. We can release the routes and cause new route lookups and source address selection so that new addresses can be used as source. Additionally, we don't need to lookup routes for all transports at the same time. We can let the transmit code path update the cached route when the transport actually sends something. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 844adfdeb463..f87ccb11a520 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3193,11 +3193,8 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
3193 local_bh_enable(); 3193 local_bh_enable();
3194 list_for_each_entry(transport, &asoc->peer.transport_addr_list, 3194 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
3195 transports) { 3195 transports) {
3196 if (transport->state == SCTP_ACTIVE)
3197 continue;
3198 dst_release(transport->dst); 3196 dst_release(transport->dst);
3199 sctp_transport_route(transport, NULL, 3197 transport->dst = NULL;
3200 sctp_sk(asoc->base.sk));
3201 } 3198 }
3202 break; 3199 break;
3203 case SCTP_PARAM_DEL_IP: 3200 case SCTP_PARAM_DEL_IP:
@@ -3207,8 +3204,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
3207 list_for_each_entry(transport, &asoc->peer.transport_addr_list, 3204 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
3208 transports) { 3205 transports) {
3209 dst_release(transport->dst); 3206 dst_release(transport->dst);
3210 sctp_transport_route(transport, NULL, 3207 transport->dst = NULL;
3211 sctp_sk(asoc->base.sk));
3212 } 3208 }
3213 break; 3209 break;
3214 default: 3210 default: