netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SCTP: Move sctp_v4_dst_saddr out of loop
@ 2008-06-03  5:41 Gui Jianfeng
  2008-06-03 15:41 ` Vlad Yasevich
  0 siblings, 1 reply; 2+ messages in thread
From: Gui Jianfeng @ 2008-06-03  5:41 UTC (permalink / raw)
  To: vladislav; +Cc: netdev, linux-sctp, David Miller

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>
---
 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 c2dd65d..b51d980 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;
 		}
-- 
1.5.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] SCTP: Move sctp_v4_dst_saddr out of loop
  2008-06-03  5:41 [PATCH] SCTP: Move sctp_v4_dst_saddr out of loop Gui Jianfeng
@ 2008-06-03 15:41 ` Vlad Yasevich
  0 siblings, 0 replies; 2+ messages in thread
From: Vlad Yasevich @ 2008-06-03 15:41 UTC (permalink / raw)
  To: Gui Jianfeng; +Cc: netdev, linux-sctp, David Miller

Hi Gui

Gui Jianfeng wrote:
> 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>

I'll put this in the set that I am getting ready to submit.

-vlad

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-03 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-03  5:41 [PATCH] SCTP: Move sctp_v4_dst_saddr out of loop Gui Jianfeng
2008-06-03 15:41 ` Vlad Yasevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).