lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1395040188-24840-1-git-send-email-roy.qing.li@gmail.com>
Date:	Mon, 17 Mar 2014 15:09:47 +0800
From:	roy.qing.li@...il.com
To:	netdev@...r.kernel.org
Subject: [PATCH][net-next] netpoll: slight optimization for netpoll_neigh_reply

From: Li RongQing <roy.qing.li@...il.com>

'hits' is used to check If there is a device who is interested
in this skb, not care the device number, so stop the loop once
a device is found

Signed-off-by: Li RongQing <roy.qing.li@...il.com>
---
 net/core/netpoll.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index dd0a796..9a276e6 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -545,8 +545,10 @@ static void netpoll_neigh_reply(struct sk_buff *skb, struct netpoll_info *npinfo
 	   inspection whether this is interesting at all */
 	spin_lock_irqsave(&npinfo->rx_lock, flags);
 	list_for_each_entry_safe(np, tmp, &npinfo->rx_np, rx) {
-		if (np->dev == skb->dev)
+		if (np->dev == skb->dev) {
 			hits++;
+			break;
+		}
 	}
 	spin_unlock_irqrestore(&npinfo->rx_lock, flags);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ