summaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2016-01-16 07:17:17 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-17 19:11:44 -0500
commitdd7445ad6be3809565272b0e724f2f00c2de1989 (patch)
tree2362c43a03fcaa7981fd19b41c1c9bc86e02d5fc /net/sctp/input.c
parent0b6e26ce89391327d955a756a7823272238eb867 (diff)
sctp: the temp asoc's transports should not be hashed/unhashed
Re-establish the previous behavior and avoid hashing temporary asocs by checking t->asoc->temp in sctp_(un)hash_transport. Also, remove the check of t->asoc->temp in __sctp_lookup_association, since they are never hashed now. Fixes: 4f0087812648 ("sctp: apply rhashtable api to send/recv path") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Reported-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index b9a536b52da2..bf61dfb8e09e 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -874,6 +874,9 @@ void sctp_hash_transport(struct sctp_transport *t)
874{ 874{
875 struct sctp_hash_cmp_arg arg; 875 struct sctp_hash_cmp_arg arg;
876 876
877 if (t->asoc->temp)
878 return;
879
877 arg.ep = t->asoc->ep; 880 arg.ep = t->asoc->ep;
878 arg.paddr = &t->ipaddr; 881 arg.paddr = &t->ipaddr;
879 arg.net = sock_net(t->asoc->base.sk); 882 arg.net = sock_net(t->asoc->base.sk);
@@ -886,6 +889,9 @@ reinsert:
886 889
887void sctp_unhash_transport(struct sctp_transport *t) 890void sctp_unhash_transport(struct sctp_transport *t)
888{ 891{
892 if (t->asoc->temp)
893 return;
894
889 rhashtable_remove_fast(&sctp_transport_hashtable, &t->node, 895 rhashtable_remove_fast(&sctp_transport_hashtable, &t->node,
890 sctp_hash_params); 896 sctp_hash_params);
891} 897}
@@ -931,7 +937,7 @@ static struct sctp_association *__sctp_lookup_association(
931 struct sctp_transport *t; 937 struct sctp_transport *t;
932 938
933 t = sctp_addrs_lookup_transport(net, local, peer); 939 t = sctp_addrs_lookup_transport(net, local, peer);
934 if (!t || t->dead || t->asoc->temp) 940 if (!t || t->dead)
935 return NULL; 941 return NULL;
936 942
937 sctp_association_hold(t->asoc); 943 sctp_association_hold(t->asoc);