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  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]
Date:	Thu, 18 Sep 2008 22:53:20 +0300 (EEST)
From:	"Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To:	Ivan Vecera <ivecera@...hat.com>
cc:	Francois Romieu <romieu@...zoreil.com>,
	Netdev <netdev@...r.kernel.org>,
	Edward Hsu <edward_hsu@...ltek.com.tw>
Subject: Re: [PATCH] r8169: read MAC address from EEPROM on init

On Thu, 18 Sep 2008, Ivan Vecera wrote:
> This fixes the problem when MAC address is set by ifconfig or by
> ip link commands and this address is stored in the device after
> reboot. The power-off is needed to get right MAC address.
> This is problem when Xen daemon is running because it renames the device
> name from ethX to pethX and sets its MAC address to FE:FF:FF:FF:FF:FF.
> After reboot the device is still using FE:FF:FF:FF:FF:FF.
> 
> Signed-off-by: Ivan Vecera <ivecera@...hat.com>
> ---
>  drivers/net/r8169.c |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 79 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index befc927..b09a4ec 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c

...

> +	 * is always consecutive 4-byte data starting from the VPD address
> +	 * specified."
> +	 */
> +	if (rtl_eeprom_read(tp->pci_dev, vpd_cap, 0x000e, &low) < 0 ||
> +	    rtl_eeprom_read(tp->pci_dev, vpd_cap, 0x0012, &high) < 0) {
> +		dprintk("Reading MAC address from EEPROM failed\n");
> +		return;
> +	}
> +
> +	/* Mask hi-word */
> +	high &= 0xffff;

...Hmm, and besides fixing sparse printouts, this looks like a real 
endianness bug.


-- 
 i.
--
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