mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Danny Kukawka <danny.kukawka@bisect.de>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Danny Kukawka <dkukawka@suse.de>,
	"David S. Miller" <davem@davemloft.net>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Jiri Pirko <jpirko@redhat.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 03/12] dvb_net: check given MAC address, if invalid return -EADDRNOTAVAIL
Date: Fri, 24 Feb 2012 17:01:13 +0100	[thread overview]
Message-ID: <1330099282-4588-4-git-send-email-danny.kukawka@bisect.de> (raw)
In-Reply-To: <1330099282-4588-1-git-send-email-danny.kukawka@bisect.de>

Check if given address is valid in .ndo_set_mac_address, if
invalid return -EADDRNOTAVAIL as eth_mac_addr() already does
if is_valid_ether_addr() fails.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
 drivers/media/dvb/dvb-core/dvb_net.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index 8766ce8..ebae67e 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -1190,7 +1190,10 @@ static void wq_restart_net_feed (struct work_struct *work)
 static int dvb_net_set_mac (struct net_device *dev, void *p)
 {
 	struct dvb_net_priv *priv = netdev_priv(dev);
-	struct sockaddr *addr=p;
+	struct sockaddr *addr = p;
+
+	if (!is_valid_ether_addr(addr->sa_data))
+		return -EADDRNOTAVAIL;
 
 	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
-- 
1.7.8.3


  parent reply	other threads:[~2012-02-24 16:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 16:01 [PATCH 00/12] Part 2: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 01/12] ethernet: .ndo_set_mac_address: check given " Danny Kukawka
2012-02-24 16:01 ` [PATCH 02/12] cris/eth_v10: check given MAC " Danny Kukawka
2012-02-25 17:18   ` Jesper Nilsson
2012-02-24 16:01 ` Danny Kukawka [this message]
2012-02-24 16:01 ` [PATCH 04/12] fddi/skfp: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 05/12] team: " Danny Kukawka
2012-02-26  0:07   ` Jiri Pirko
2012-02-24 16:01 ` [PATCH 06/12] tokenring: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 07/12] usb/rtl8150: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 08/12] vmxnet3: " Danny Kukawka
2012-02-24 16:31   ` [Pv-drivers] " Bhavesh Davda
2012-02-24 16:01 ` [PATCH 09/12] wan/lapbether: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 10/12] wireless: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 11/12] s390/net/qeth_l2_main: " Danny Kukawka
2012-02-24 16:01 ` [PATCH 12/12] rose: " Danny Kukawka
2012-02-24 16:13   ` Alan Cox
2012-02-24 20:43     ` David Miller
2012-02-25 18:25       ` Danny Kukawka
2012-02-24 17:59 ` [PATCH 00/12] Part 2: " Michał Mirosław
2012-02-25 10:13   ` Geert Uytterhoeven
2012-02-29  7:02     ` Danny Kukawka

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=1330099282-4588-4-git-send-email-danny.kukawka@bisect.de \
    --to=danny.kukawka@bisect.de \
    --cc=davem@davemloft.net \
    --cc=dkukawka@suse.de \
    --cc=jpirko@redhat.com \
    --cc=jrnieder@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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

all inboxes | Powered by JetHome®