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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428907677-27204-3-git-send-email-simon.horman@netronome.com>
Date:	Mon, 13 Apr 2015 15:47:55 +0900
From:	Simon Horman <simon.horman@...ronome.com>
To:	Jiri Pirko <jiri@...nulli.us>, Scott Feldman <sfeldma@...il.com>
Cc:	netdev@...r.kernel.org, Simon Horman <simon.horman@...ronome.com>
Subject: [PATCH/RFC net-next 2/4] rocker: set untagged VLAN when opening port

When joining a bridge rocker sets the untagged VLAN of a port
according to the ifindex of its bridge device.

And when leaving a bridge rocker sets the untagged VLAN of a port
according to the ifindex of the port's device.

So after joining and leaving a VLAN the untagged VLAN of a port will
be set according to the latter. However, prior to joining a VLAN it is
unset.

This patch sets the untagged VLAN of a port according to the ifindex
of the port's device when the port's device is opened. That is, the same
value that can be achieved by joining then leaving a VLAN. Which seems
logical and consistent.

Signed-off-by: Simon Horman <simon.horman@...ronome.com>
---
 drivers/net/ethernet/rocker/rocker.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 955cf0ae33a7..b88097b26587 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -3853,9 +3853,13 @@ static int rocker_port_open(struct net_device *dev)
 		goto err_request_rx_irq;
 	}
 
+	err = rocker_port_set_untagged_vlan(rocker_port);
+	if (err)
+		goto err_set_vlan;
+
 	err = rocker_port_fwd_enable(rocker_port);
 	if (err)
-		goto err_fwd_enable;
+		goto err_set_vlan;
 
 	napi_enable(&rocker_port->napi_tx);
 	napi_enable(&rocker_port->napi_rx);
@@ -3863,7 +3867,7 @@ static int rocker_port_open(struct net_device *dev)
 	netif_start_queue(dev);
 	return 0;
 
-err_fwd_enable:
+err_set_vlan:
 	free_irq(rocker_msix_rx_vector(rocker_port), rocker_port);
 err_request_rx_irq:
 	free_irq(rocker_msix_tx_vector(rocker_port), rocker_port);
-- 
2.1.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