linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danny Kukawka <danny.kukawka@bisect.de>
To: "David S. Miller" <davem@davemloft.net>
Cc: Danny Kukawka <dkukawka@suse.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	John Crispin <blogic@openwrt.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [PATCH 15/50] lantiq_etop: set addr_assign_type if random_ether_addr() used
Date: Wed,  8 Feb 2012 22:10:22 +0100	[thread overview]
Message-ID: <1328735457-29986-16-git-send-email-danny.kukawka@bisect.de> (raw)
In-Reply-To: <1328735457-29986-1-git-send-email-danny.kukawka@bisect.de>

Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/net/ethernet/lantiq_etop.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 85e2c6c..b4f5108 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -634,6 +634,7 @@ ltq_etop_init(struct net_device *dev)
 	struct ltq_etop_priv *priv = netdev_priv(dev);
 	struct sockaddr mac;
 	int err;
+	bool random = false;
 
 	ether_setup(dev);
 	dev->watchdog_timeo = 10 * HZ;
@@ -646,9 +647,12 @@ ltq_etop_init(struct net_device *dev)
 	if (!is_valid_ether_addr(mac.sa_data)) {
 		pr_warn("etop: invalid MAC, using random\n");
 		random_ether_addr(mac.sa_data);
+		random = true;
 	}
 
 	err = ltq_etop_set_mac_address(dev, &mac);
+	if (random)
+		dev->addr_assign_type |= NET_ADDR_RANDOM;
 	if (err)
 		goto err_netdev;
 	ltq_etop_set_multicast_list(dev);
-- 
1.7.7.3


  parent reply	other threads:[~2012-02-08 21:20 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 21:10 [RFC][PATCH 00/50] set addr_assign_type to NET_ADDR_RANDOM if a random mac address get assigned to a netdevice Danny Kukawka
2012-02-08 21:10 ` [PATCH 01/50] eth: reset addr_assign_type if eth_mac_addr() called Danny Kukawka
2012-02-08 22:50   ` Stephen Hemminger
2012-02-08 22:57     ` Danny Kukawka
2012-02-08 21:10 ` [PATCH 02/50] smsc95xx: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-09 10:51   ` Sergei Shtylyov
2012-02-08 21:10 ` [PATCH 03/50] smsc75xx: se " Danny Kukawka
2012-02-08 21:10 ` [PATCH 04/50] adi/blackfin: set addr_assign_type correctly if random Danny Kukawka
2012-02-09  3:28   ` Bob Liu
2012-02-09  4:05   ` Mike Frysinger
2012-02-08 21:10 ` [PATCH 05/50] UML net: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:10 ` [PATCH 06/50] dummy: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 07/50] au1000_eth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 08/50] bnx2x: " Danny Kukawka
2012-02-09  9:59   ` David Laight
2012-02-08 21:10 ` [PATCH 09/50] Cadence MACB: " Danny Kukawka
2012-02-09  8:24   ` Nicolas Ferre
2012-02-08 21:10 ` [PATCH 10/50] Calxeda XGMAC: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 11/50] ep93xx: " Danny Kukawka
2012-02-08 21:29   ` H Hartley Sweeten
2012-02-08 21:10 ` [PATCH 12/50] dm9000: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 13/50] dnet: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 14/50] ethoc: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:10 ` Danny Kukawka [this message]
2012-02-08 21:10 ` [PATCH 16/50] pxa168_eth: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 17/50] enc28j60: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 18/50] mipsnet: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 19/50] macsonic: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 20/50] smsc911x: " Danny Kukawka
2012-02-09 11:28   ` Mark Brown
2012-02-08 21:10 ` [PATCH 21/50] smsc9420: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 22/50] r6040: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 23/50] efx: " Danny Kukawka
2012-02-08 21:29   ` Ben Hutchings
2012-02-08 21:10 ` [PATCH 24/50] sis900: " Danny Kukawka
2012-02-11  9:05   ` Daniele Venzano
2012-02-08 21:10 ` [PATCH 25/50] via-rhine: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 26/50] faraday: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 27/50] davinci_emac: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 28/50] forcedeth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 29/50] micrel eth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 30/50] atheros eth: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:10 ` [PATCH 31/50] tc35815: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 32/50] tile_net: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 33/50] stmmac: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 34/50] xilinx ll_temac: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 35/50] ifb: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 36/50] igbvf: reset netdevice addr_assign_type if changed from random Danny Kukawka
2012-02-08 21:10 ` [PATCH 37/50] usbnet: set addr_assign_type if random_ether_addr() used Danny Kukawka
2012-02-08 21:30   ` Oliver Neukum
2012-02-08 21:41     ` Danny Kukawka
2012-02-09  6:57     ` Bjørn Mork
2012-02-09 14:55       ` Oliver Neukum
2012-02-08 21:10 ` [PATCH 38/50] g_ether: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 39/50] veth: use dev_hw_addr_random() instead of random_ether_addr() Danny Kukawka
2012-02-08 21:10 ` [PATCH 40/50] batman-adv: " Danny Kukawka
2012-02-09  8:44   ` [B.A.T.M.A.N.] " Sven Eckelmann
2012-02-11 11:12   ` Marek Lindner
2012-02-08 21:10 ` [PATCH 41/50] l2tp_eth: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 42/50] virtio_net: " Danny Kukawka
2012-02-09  9:35   ` Michael S. Tsirkin
2012-02-08 21:10 ` [PATCH 43/50] macvlan: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 44/50] team: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 45/50] tun: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 46/50] wan: " Danny Kukawka
2012-02-09 14:12   ` Krzysztof Halasa
2012-02-08 21:10 ` [PATCH 47/50] bridge: " Danny Kukawka
2012-02-08 22:52   ` Stephen Hemminger
2012-02-08 21:10 ` [PATCH 48/50] ip_gre.c: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 49/50] openvswitch: " Danny Kukawka
2012-02-08 21:10 ` [PATCH 50/50] " Danny Kukawka
2012-02-08 22:58 ` [RFC][PATCH 00/50] set addr_assign_type to NET_ADDR_RANDOM if a random mac address get assigned to a netdevice Stephen Hemminger
2012-02-09 14:59   ` Danny Kukawka
2012-02-09 16:06     ` Stephen Hemminger
2012-02-08 23:29 ` David Miller
2012-02-09 12:18   ` Danny Kukawka
2012-02-09 18:37     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328735457-29986-16-git-send-email-danny.kukawka@bisect.de \
    --to=danny.kukawka@bisect.de \
    --cc=blogic@openwrt.org \
    --cc=davem@davemloft.net \
    --cc=dkukawka@suse.de \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).