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  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]
Date:   Thu,  9 Nov 2017 09:39:32 -0500
From:   Vivien Didelot <>
        "David S. Miller" <>,
        Florian Fainelli <>,
        Andrew Lunn <>,
        Vivien Didelot <>
Subject: [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port"

We may have to pass a port's dedicated CPU port to port-wide functions
such as dsa_port_mdb_add, e.g. when offloading bridge device's MDB.

The DSA port-wide functions currently take a non-const struct dsa_port *
as first argument so we cannot make cpu_dp const yet, even though it'd
be more correct. Revert this patch and make cpu_dp non-const again.

This reverts commit 24a9332a58b7f41a0d36c35a2c6897242bffdbc0.
 include/net/dsa.h | 2 +-
 net/dsa/slave.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index 6c239257309b..35b5dee7bb23 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -190,7 +190,7 @@ struct dsa_port {
 	struct dsa_switch	*ds;
 	unsigned int		index;
 	const char		*name;
-	const struct dsa_port	*cpu_dp;
+	struct dsa_port		*cpu_dp;
 	struct device_node	*dn;
 	unsigned int		ageing_time;
 	u8			stp_state;
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index cc7fe47dd4bf..814ced75a0cc 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1147,7 +1147,7 @@ static void dsa_slave_notify(struct net_device *dev, unsigned long val)
 int dsa_slave_create(struct dsa_port *port)
-	const struct dsa_port *cpu_dp = port->cpu_dp;
+	struct dsa_port *cpu_dp = port->cpu_dp;
 	struct net_device *master = cpu_dp->master;
 	struct dsa_switch *ds = port->ds;
 	const char *name = port->name;

Powered by blists - more mailing lists