From: Justin Cormack <jus...@myriabit.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 <jus...@netbsd.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to