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: <20150511.134901.959375179450827063.davem@davemloft.net>
Date:	Mon, 11 May 2015 13:49:01 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	justin@...iabit.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH v3] macvtap add missing ioctls - fix wrapping

From: Justin Cormack <justin@...iabit.com>
Date: Sun, 10 May 2015 13:50:15 +0100

> The macvtap driver tries to emulate all the ioctls supported by a normal
> tun/tap driver, however it was missing the generic SIOCGIFHWADDR and
> SIOCSIFHWADDR ioctls to get and set the mac address that are supported
> by tun/tap. This patch adds these.
> 
> Signed-off-by: Justin Cormack <justin@...bsd.org>
> 
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index 8c350c5..f37e8f9 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -1101,6 +1101,35 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
>  		rtnl_unlock();
>  		return ret;
>  
> +	case SIOCGIFHWADDR:
> +		rtnl_lock();
> +		vlan = macvtap_get_vlan(q);
> +		if (!vlan) {
> +			rtnl_unlock();
> +			return -ENOLINK;
> +		}
> +		ret = 0;
> +		u = vlan->dev->type;
> +		if (copy_to_user(&ifr->ifr_name, vlan->dev->name, IFNAMSIZ) ||
> +			copy_to_user(&ifr->ifr_hwaddr.sa_data, vlan->dev->dev_addr, ETH_ALEN) ||
> +			put_user(u, &ifr->ifr_hwaddr.sa_family))

This is not indented correctly.

When an if() statement spans multiple lines, the second and subsequent lines
should start exactly at the first column following the openning parenthesis
of the first line.  You should use the appropriate number of TAB then
SPACE characters necessary to achieve this.

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