[PATCH] net: make eth_register_ethaddr work on registered network devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When eth_register_ethaddr is called after the device has been registered
it should work aswell.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 net/eth.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/eth.c b/net/eth.c
index a090961..c381ebd 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -100,9 +100,17 @@ static void eth_drop_ethaddr(int ethid)
 void eth_register_ethaddr(int ethid, const char *ethaddr)
 {
 	struct eth_ethaddr *addr;
+	struct eth_device *edev;
 
 	eth_drop_ethaddr(ethid);
 
+	list_for_each_entry(edev, &netdev_list, list) {
+		if (edev->dev.id == ethid) {
+			register_preset_mac_address(edev, ethaddr);
+			return;
+		}
+	}
+
 	addr = xzalloc(sizeof(*addr));
 	addr->ethid = ethid;
 	memcpy(addr->ethaddr, ethaddr, 6);
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux