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: <CAP=VYLqpUun0FtCs4VWDeLm-mAri=+UV3psRA12eVbV1So_c-Q@mail.gmail.com>
Date:	Mon, 23 Jan 2012 15:53:05 -0500
From:	Paul Gortmaker <paul.gortmaker@...il.com>
To:	"Torne (Richard Coles)" <torne@...gle.com>
Cc:	nic_swsd@...ltek.com, romieu@...zoreil.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] r8169: Randomise invalid MAC addresses

On Mon, Jan 23, 2012 at 1:32 PM, Torne (Richard Coles) <torne@...gle.com> wrote:
> From: "Torne (Richard Coles)" <torne@...gle.com>
>
> If the default MAC address stored in the card is invalid, replace it
> with a random address and complain about it.

You might want to have a look at this thread and its outcome.

https://lkml.org/lkml/2012/1/14/75

Paul.

>
> Signed-off-by: Torne (Richard Coles) <torne@...gle.com>
> ---
>  drivers/net/ethernet/realtek/r8169.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 7a0c800..ec5ebbb 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -4103,6 +4103,14 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>        /* Get MAC address */
>        for (i = 0; i < ETH_ALEN; i++)
>                dev->dev_addr[i] = RTL_R8(MAC0 + i);
> +
> +       if (!is_valid_ether_addr(dev->dev_addr)) {
> +               /* Report it and use a random ethernet address instead */
> +               netdev_err(dev, "Invalid MAC address: %pM\n", dev->dev_addr);
> +               random_ether_addr(dev->dev_addr);
> +               netdev_info(dev, "Using random MAC address: %pM\n",
> +                           dev->dev_addr);
> +       }
>        memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
>
>        SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops);
> --
> 1.7.7.3
>
> --
> 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
--
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