From: "Michael S. Tsirkin" <mst@redhat•com>
To: Jiri Pirko <jpirko@redhat•com>
Cc: netdev@vger•kernel.org, shimoda.hiroaki@gmail•com,
virtualization@lists•linux-foundation.org,
danny.kukawka@bisect•de, edumazet@google•com,
davem@davemloft•net
Subject: Re: [patch net-next 2/4] virtio_net: use IFF_LIFE_ADDR_CHANGE priv_flag
Date: Thu, 28 Jun 2012 22:21:23 +0300 [thread overview]
Message-ID: <20120628192123.GA14787@redhat.com> (raw)
In-Reply-To: <1340892639-1111-3-git-send-email-jpirko@redhat.com>
On Thu, Jun 28, 2012 at 04:10:37PM +0200, Jiri Pirko wrote:
> Signed-off-by: Jiri Pirko <jpirko@redhat•com>
FWIW
Acked-by: Michael S. Tsirkin <mst@redhat•com>
> ---
> drivers/net/virtio_net.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 36a16d5..6a0f526 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -679,12 +679,11 @@ static int virtnet_set_mac_address(struct net_device *dev, void *p)
> {
> struct virtnet_info *vi = netdev_priv(dev);
> struct virtio_device *vdev = vi->vdev;
> - struct sockaddr *addr = p;
> + int ret;
>
> - if (!is_valid_ether_addr(addr->sa_data))
> - return -EADDRNOTAVAIL;
> - memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
> - dev->addr_assign_type &= ~NET_ADDR_RANDOM;
> + ret = eth_mac_addr(dev, p);
> + if (ret)
> + return ret;
>
> if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC))
> vdev->config->set(vdev, offsetof(struct virtio_net_config, mac),
> @@ -1063,7 +1062,7 @@ static int virtnet_probe(struct virtio_device *vdev)
> return -ENOMEM;
>
> /* Set up network device as normal. */
> - dev->priv_flags |= IFF_UNICAST_FLT;
> + dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIFE_ADDR_CHANGE;
> dev->netdev_ops = &virtnet_netdev;
> dev->features = NETIF_F_HIGHDMA;
>
> --
> 1.7.10.4
next prev parent reply other threads:[~2012-06-28 19:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-28 14:10 [patch net-next 0/4] net: introduce and use IFF_LIFE_ADDR_CHANGE Jiri Pirko
2012-06-28 14:10 ` [patch net-next 1/4] net: introduce new priv_flag indicating iface capable of change mac when running Jiri Pirko
2012-06-28 15:24 ` Eric Dumazet
2012-06-28 20:32 ` Michael S. Tsirkin
2012-06-28 22:17 ` Ben Hutchings
2012-06-29 6:41 ` Jiri Pirko
2012-06-28 14:10 ` [patch net-next 2/4] virtio_net: use IFF_LIFE_ADDR_CHANGE priv_flag Jiri Pirko
2012-06-28 19:21 ` Michael S. Tsirkin [this message]
2012-06-28 14:10 ` [patch net-next 3/4] team: " Jiri Pirko
2012-06-28 14:10 ` [patch net-next 4/4] dummy: " Jiri Pirko
2012-06-28 15:15 ` [patch net-next 0/4] net: introduce and use IFF_LIFE_ADDR_CHANGE Richard Cochran
2012-06-28 15:41 ` Jiri Pirko
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=20120628192123.GA14787@redhat.com \
--to=mst@redhat$(echo .)com \
--cc=danny.kukawka@bisect$(echo .)de \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=jpirko@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=shimoda.hiroaki@gmail$(echo .)com \
--cc=virtualization@lists$(echo .)linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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