All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND net-next] net: usbnet: update addr_assign_type if appropriate
@ 2013-09-04  7:42 Bjørn Mork
  2013-09-05 16:45 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Bjørn Mork @ 2013-09-04  7:42 UTC (permalink / raw
  To: netdev; +Cc: linux-usb, Bjørn Mork

This module generates a common default address on init,
using eth_random_addr. Set addr_assign_type to let
userspace know the address is random unless it was
overridden by the minidriver.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Oliver Neukum <oliver@neukum.org>
---
Sorry this patch missed the "addr_assign_type series" where it should
have been.

 drivers/net/usb/usbnet.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index e4811d7..74a8e3c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1629,6 +1629,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 		dev->rx_urb_size = dev->hard_mtu;
 	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
 
+	/* let userspace know we have a random address */
+	if (ether_addr_equal(net->dev_addr, node_id))
+		net->addr_assign_type = NET_ADDR_RANDOM;
+
 	if ((dev->driver_info->flags & FLAG_WLAN) != 0)
 		SET_NETDEV_DEVTYPE(net, &wlan_type);
 	if ((dev->driver_info->flags & FLAG_WWAN) != 0)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND net-next] net: usbnet: update addr_assign_type if appropriate
  2013-09-04  7:42 [PATCH RESEND net-next] net: usbnet: update addr_assign_type if appropriate Bjørn Mork
@ 2013-09-05 16:45 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-09-05 16:45 UTC (permalink / raw
  To: bjorn; +Cc: netdev, linux-usb

From: Bjørn Mork <bjorn@mork.no>
Date: Wed,  4 Sep 2013 09:42:32 +0200

> This module generates a common default address on init,
> using eth_random_addr. Set addr_assign_type to let
> userspace know the address is random unless it was
> overridden by the minidriver.
> 
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
> Acked-by: Oliver Neukum <oliver@neukum.org>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-05 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04  7:42 [PATCH RESEND net-next] net: usbnet: update addr_assign_type if appropriate Bjørn Mork
2013-09-05 16:45 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.