aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2018-03-26 04:55:00 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-27 10:22:11 -0400
commit5306653850b444452937834adc5a5ac63bae275e (patch)
treec1c94686f9b5e6c77548cf6143156bd7041be5e6
parent13d5a30a1e78fb6ce3f1dcddf8c14bd0a81b3bb3 (diff)
sctp: remove unnecessary asoc in sctp_has_association
After Commit dae399d7fdee ("sctp: hold transport instead of assoc when lookup assoc in rx path"), it put transport instead of asoc in sctp_has_association. Variable 'asoc' is not used any more. So this patch is to remove it, while at it, it also changes the return type of sctp_has_association to bool, and does the same for it's caller sctp_endpoint_is_peeled_off. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sctp/structs.h8
-rw-r--r--net/sctp/endpointola.c8
-rw-r--r--net/sctp/input.c13
3 files changed, 14 insertions, 15 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 012fb3e2f4cf..c63249ea34c3 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1341,12 +1341,12 @@ struct sctp_association *sctp_endpoint_lookup_assoc(
1341 const struct sctp_endpoint *ep, 1341 const struct sctp_endpoint *ep,
1342 const union sctp_addr *paddr, 1342 const union sctp_addr *paddr,
1343 struct sctp_transport **); 1343 struct sctp_transport **);
1344int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, 1344bool sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
1345 const union sctp_addr *); 1345 const union sctp_addr *paddr);
1346struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, 1346struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *,
1347 struct net *, const union sctp_addr *); 1347 struct net *, const union sctp_addr *);
1348int sctp_has_association(struct net *net, const union sctp_addr *laddr, 1348bool sctp_has_association(struct net *net, const union sctp_addr *laddr,
1349 const union sctp_addr *paddr); 1349 const union sctp_addr *paddr);
1350 1350
1351int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, 1351int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
1352 const struct sctp_association *asoc, 1352 const struct sctp_association *asoc,
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 8b3146816519..e2f5a3ee41a7 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -349,8 +349,8 @@ out:
349/* Look for any peeled off association from the endpoint that matches the 349/* Look for any peeled off association from the endpoint that matches the
350 * given peer address. 350 * given peer address.
351 */ 351 */
352int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep, 352bool sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
353 const union sctp_addr *paddr) 353 const union sctp_addr *paddr)
354{ 354{
355 struct sctp_sockaddr_entry *addr; 355 struct sctp_sockaddr_entry *addr;
356 struct sctp_bind_addr *bp; 356 struct sctp_bind_addr *bp;
@@ -362,10 +362,10 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
362 */ 362 */
363 list_for_each_entry(addr, &bp->address_list, list) { 363 list_for_each_entry(addr, &bp->address_list, list) {
364 if (sctp_has_association(net, &addr->a, paddr)) 364 if (sctp_has_association(net, &addr->a, paddr))
365 return 1; 365 return true;
366 } 366 }
367 367
368 return 0; 368 return false;
369} 369}
370 370
371/* Do delayed input processing. This is scheduled by sctp_rcv(). 371/* Do delayed input processing. This is scheduled by sctp_rcv().
diff --git a/net/sctp/input.c b/net/sctp/input.c
index b381d78548ac..ba8a6e6c36fa 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -1010,19 +1010,18 @@ struct sctp_association *sctp_lookup_association(struct net *net,
1010} 1010}
1011 1011
1012/* Is there an association matching the given local and peer addresses? */ 1012/* Is there an association matching the given local and peer addresses? */
1013int sctp_has_association(struct net *net, 1013bool sctp_has_association(struct net *net,
1014 const union sctp_addr *laddr, 1014 const union sctp_addr *laddr,
1015 const union sctp_addr *paddr) 1015 const union sctp_addr *paddr)
1016{ 1016{
1017 struct sctp_association *asoc;
1018 struct sctp_transport *transport; 1017 struct sctp_transport *transport;
1019 1018
1020 if ((asoc = sctp_lookup_association(net, laddr, paddr, &transport))) { 1019 if (sctp_lookup_association(net, laddr, paddr, &transport)) {
1021 sctp_transport_put(transport); 1020 sctp_transport_put(transport);
1022 return 1; 1021 return true;
1023 } 1022 }
1024 1023
1025 return 0; 1024 return false;
1026} 1025}
1027 1026
1028/* 1027/*