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]
Date:	Mon, 18 Oct 2010 20:52:21 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	Jeff Garzik <jeff@...zik.org>, netdev@...r.kernel.org
Subject: Re: [PATCH] ethtool: add get permanent address option

On Mon, 2010-10-18 at 11:41 -0700, Stephen Hemminger wrote:
> Add command level support for showing permanent address.
> The ioctl has been around for a long time but there was
> no option to display it.
> 
> Note: MAX_ADDR_LEN is defined in netdevice.h but including
> netdevice.h leads to multiple definition errors with if.h.
[...]
> @@ -2950,6 +2961,29 @@ static int do_flash(int fd, struct ifreq *ifr)
>  	return err;
>  }
>  
> +static int do_permaddr(int fd, struct ifreq *ifr)
> +{
> +	int i, err;
> +	struct ethtool_perm_addr *epaddr;
> +
> +	epaddr = malloc(sizeof(struct ethtool_perm_addr) + MAX_ADDR_LEN);
> +	epaddr->cmd = ETHTOOL_GPERMADDR;
> +	epaddr->size = MAX_ADDR_LEN;
> +	ifr->ifr_data = (caddr_t)epaddr;
> +
> +	err = send_ioctl(fd, ifr);
> +	if (err < 0)
> +		perror("Cannot read permanent address\n");
[...]

Don't include a newline in the argument to perror().

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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