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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  5 Jan 2015 15:50:10 +0900
From:	Simon Horman <simon.horman@...ronome.com>
To:	John Fastabend <john.fastabend@...il.com>
Cc:	netdev@...r.kernel.org, Simon Horman <simon.horman@...ronome.com>
Subject: [PATCH/RFC rocker-net-next 6/6] net: flow: Limit checking of ndo_flow_{set,del}_flows

Only check for availability of ndo_flow_{set,del}_flows when
they are to be be used.

Signed-off-by: Simon Horman <simon.horman@...ronome.com>
---
 net/core/flow_table.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/core/flow_table.c b/net/core/flow_table.c
index bfc984f..6d620d4 100644
--- a/net/core/flow_table.c
+++ b/net/core/flow_table.c
@@ -1206,9 +1206,20 @@ static int net_flow_table_cmd_flows(struct sk_buff *recv_skb,
 	if (!dev)
 		return -EINVAL;
 
-	if (!dev->netdev_ops->ndo_flow_set_flows ||
-	    !dev->netdev_ops->ndo_flow_del_flows)
+	switch (cmd) {
+	case NET_FLOW_TABLE_CMD_SET_FLOWS:
+		if (!dev->netdev_ops->ndo_flow_set_flows)
+			goto out;
+		break;
+
+	case NET_FLOW_TABLE_CMD_DEL_FLOWS:
+		if (!dev->netdev_ops->ndo_flow_del_flows)
+			goto out;
+		break;
+
+	default:
 		goto out;
+	}
 
 	if (!info->attrs[NET_FLOW_IDENTIFIER_TYPE] ||
 	    !info->attrs[NET_FLOW_IDENTIFIER] ||
-- 
2.1.3

--
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