netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: justin@myriabit.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v3] macvtap add missing ioctls - fix wrapping
Date: Mon, 11 May 2015 13:49:01 -0400 (EDT)	[thread overview]
Message-ID: <20150511.134901.959375179450827063.davem@davemloft.net> (raw)
In-Reply-To: <1431262215.3278.2.camel@myriabit.com>

From: Justin Cormack <justin@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 <justin@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.

  reply	other threads:[~2015-05-11 17:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 15:56 [PATCH] macvtap add missing ioctls Justin Cormack
2015-05-09 21:40 ` David Miller
2015-05-10  9:15   ` [PATCH v2] " Justin Cormack
2015-05-10 12:50     ` [PATCH v3] macvtap add missing ioctls - fix wrapping Justin Cormack
2015-05-11 17:49       ` David Miller [this message]
2015-05-11 19:00         ` [PATCH v4] " Justin Cormack
2015-05-13  3:01           ` David Miller
2015-05-13 10:06             ` Justin Cormack
2015-05-13 16:06               ` David Miller
2015-05-13 11:35             ` [PATCH v5] macvtap add missing ioctls Justin Cormack
2015-05-13 16:09               ` David Miller
2015-05-13 18:19                 ` [PATCH net-next] fix missing copy_from_user in macvtap Justin Cormack
2015-05-13 18:21                   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150511.134901.959375179450827063.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=justin@myriabit.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).