diff options
author | Gui Jianfeng <guijianfeng@cn.fujitsu.com> | 2008-06-04 12:38:07 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-04 12:38:07 -0700 |
commit | 159c6bea37c54dfae44409467e0f17600722d541 (patch) | |
tree | ddac63124db30839630ca46d55688fd8cef3f1f1 /net | |
parent | 4141ddc02a92a6e3e5793601554c6033e83c25b9 (diff) | |
download | op-kernel-dev-159c6bea37c54dfae44409467e0f17600722d541.zip op-kernel-dev-159c6bea37c54dfae44409467e0f17600722d541.tar.gz |
sctp: Move sctp_v4_dst_saddr out of loop
There's no need to execute sctp_v4_dst_saddr() for each
iteration, just move it out of loop.
Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/protocol.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 13ee7fa..56bdaf7 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -470,11 +470,11 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, /* Walk through the bind address list and look for a bind * address that matches the source address of the returned dst. */ + sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); rcu_read_lock(); list_for_each_entry_rcu(laddr, &bp->address_list, list) { if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) continue; - sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); if (sctp_v4_cmp_addr(&dst_saddr, &laddr->a)) goto out_unlock; } |