Commit 53066538 authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: remove unnecessary asoc in sctp_has_association

After Commit dae399d7 ("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: default avatarXin Long <lucien.xin@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13d5a30a
...@@ -1341,12 +1341,12 @@ struct sctp_association *sctp_endpoint_lookup_assoc( ...@@ -1341,12 +1341,12 @@ struct sctp_association *sctp_endpoint_lookup_assoc(
const struct sctp_endpoint *ep, const struct sctp_endpoint *ep,
const union sctp_addr *paddr, const union sctp_addr *paddr,
struct sctp_transport **); struct sctp_transport **);
int sctp_endpoint_is_peeled_off(struct sctp_endpoint *, bool sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
const union sctp_addr *); const union sctp_addr *paddr);
struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *,
struct net *, const union sctp_addr *); struct net *, const union sctp_addr *);
int sctp_has_association(struct net *net, const union sctp_addr *laddr, bool sctp_has_association(struct net *net, const union sctp_addr *laddr,
const union sctp_addr *paddr); const union sctp_addr *paddr);
int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
const struct sctp_association *asoc, const struct sctp_association *asoc,
......
...@@ -349,8 +349,8 @@ struct sctp_association *sctp_endpoint_lookup_assoc( ...@@ -349,8 +349,8 @@ struct sctp_association *sctp_endpoint_lookup_assoc(
/* Look for any peeled off association from the endpoint that matches the /* Look for any peeled off association from the endpoint that matches the
* given peer address. * given peer address.
*/ */
int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep, bool sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
const union sctp_addr *paddr) const union sctp_addr *paddr)
{ {
struct sctp_sockaddr_entry *addr; struct sctp_sockaddr_entry *addr;
struct sctp_bind_addr *bp; struct sctp_bind_addr *bp;
...@@ -362,10 +362,10 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep, ...@@ -362,10 +362,10 @@ int sctp_endpoint_is_peeled_off(struct sctp_endpoint *ep,
*/ */
list_for_each_entry(addr, &bp->address_list, list) { list_for_each_entry(addr, &bp->address_list, list) {
if (sctp_has_association(net, &addr->a, paddr)) if (sctp_has_association(net, &addr->a, paddr))
return 1; return true;
} }
return 0; return false;
} }
/* Do delayed input processing. This is scheduled by sctp_rcv(). /* Do delayed input processing. This is scheduled by sctp_rcv().
......
...@@ -1010,19 +1010,18 @@ struct sctp_association *sctp_lookup_association(struct net *net, ...@@ -1010,19 +1010,18 @@ struct sctp_association *sctp_lookup_association(struct net *net,
} }
/* Is there an association matching the given local and peer addresses? */ /* Is there an association matching the given local and peer addresses? */
int sctp_has_association(struct net *net, bool sctp_has_association(struct net *net,
const union sctp_addr *laddr, const union sctp_addr *laddr,
const union sctp_addr *paddr) const union sctp_addr *paddr)
{ {
struct sctp_association *asoc;
struct sctp_transport *transport; struct sctp_transport *transport;
if ((asoc = sctp_lookup_association(net, laddr, paddr, &transport))) { if (sctp_lookup_association(net, laddr, paddr, &transport)) {
sctp_transport_put(transport); sctp_transport_put(transport);
return 1; return true;
} }
return 0; return false;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment