* [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL
@ 2012-02-24 16:01 Danny Kukawka
2012-02-24 16:01 ` [PATCH 11/12] s390/net/qeth_l2_main: " Danny Kukawka
2012-02-24 17:59 ` [PATCH 00/12] Part 2: " Michał Mirosław
0 siblings, 2 replies; 5+ messages in thread
From: Danny Kukawka @ 2012-02-24 16:01 UTC (permalink / raw)
To: David S. Miller, Andy Gospodarek, Guo-Fu Tseng, Petko Manolov,
VMware, Inc., John W. Linville, linux390, Mauro Carvalho Chehab
Cc: Danny Kukawka, Stephen Hemminger, Joe Perches, Jeff Kirsher,
Jiri Pirko, netdev, linux-usb, linux-wireless, libertas-dev,
linux-kernel, linux-media, linux-s390, linux-hams, linux-mips
Second Part of series patches to unifiy the return value of
.ndo_set_mac_address if the given address isn't valid.
These changes check if a given (MAC) address is valid in
.ndo_set_mac_address, if invalid return -EADDRNOTAVAIL
as eth_mac_addr() already does if is_valid_ether_addr() fails.
These patches are against net-next.
Danny Kukawka (12):
ethernet: .ndo_set_mac_address: check given address, if invalid
return -EADDRNOTAVAIL
cris/eth_v10: check given MAC address, if invalid return
-EADDRNOTAVAIL
dvb_net: check given MAC address, if invalid return -EADDRNOTAVAIL
fddi/skfp: check given MAC address, if invalid return -EADDRNOTAVAIL
team: check given MAC address, if invalid return -EADDRNOTAVAIL
tokenring: check given MAC address, if invalid return -EADDRNOTAVAIL
usb/rtl8150: check given MAC address, if invalid return
-EADDRNOTAVAIL
vmxnet3: check given MAC address, if invalid return -EADDRNOTAVAIL
wan/lapbether: check given MAC address, if invalid return
-EADDRNOTAVAIL
wireless: check given MAC address, if invalid return -EADDRNOTAVAIL
s390/net/qeth_l2_main: check given MAC address, if invalid return
-EADDRNOTAVAIL
rose: check given MAC address, if invalid return -EADDRNOTAVAIL
drivers/media/dvb/dvb-core/dvb_net.c | 5 ++++-
drivers/net/cris/eth_v10.c | 3 +++
drivers/net/ethernet/amd/amd8111e.c | 3 +++
drivers/net/ethernet/amd/atarilance.c | 3 +++
drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 3 +++
drivers/net/ethernet/cisco/enic/enic_main.c | 3 +++
drivers/net/ethernet/freescale/fec_mpc52xx.c | 3 +++
drivers/net/ethernet/jme.c | 3 +++
drivers/net/ethernet/micrel/ks8851_mll.c | 3 +++
drivers/net/ethernet/micrel/ksz884x.c | 3 +++
drivers/net/ethernet/seeq/sgiseeq.c | 3 +++
drivers/net/ethernet/sgi/ioc3-eth.c | 3 +++
drivers/net/ethernet/tehuti/tehuti.c | 3 +++
drivers/net/fddi/skfp/skfddi.c | 3 +++
drivers/net/team/team.c | 3 +++
drivers/net/tokenring/3c359.c | 4 ++++
drivers/net/tokenring/lanstreamer.c | 4 ++++
drivers/net/tokenring/olympic.c | 4 ++++
drivers/net/tokenring/tms380tr.c | 3 +++
drivers/net/usb/rtl8150.c | 3 +++
drivers/net/vmxnet3/vmxnet3_drv.c | 3 +++
drivers/net/wan/lapbether.c | 5 +++++
drivers/net/wireless/airo.c | 3 +++
drivers/net/wireless/atmel.c | 3 +++
.../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 5 ++++-
drivers/net/wireless/hostap/hostap_main.c | 3 +++
drivers/net/wireless/libertas/main.c | 3 +++
drivers/net/wireless/mwifiex/main.c | 3 +++
drivers/net/wireless/zd1201.c | 2 ++
drivers/s390/net/qeth_l2_main.c | 3 +++
net/rose/rose_dev.c | 3 +++
31 files changed, 99 insertions(+), 2 deletions(-)
--
1.7.8.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 11/12] s390/net/qeth_l2_main: check given MAC address, if invalid return -EADDRNOTAVAIL
2012-02-24 16:01 [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL Danny Kukawka
@ 2012-02-24 16:01 ` Danny Kukawka
2012-02-24 17:59 ` [PATCH 00/12] Part 2: " Michał Mirosław
1 sibling, 0 replies; 5+ messages in thread
From: Danny Kukawka @ 2012-02-24 16:01 UTC (permalink / raw)
To: Ursula Braun, Frank Blaschka, linux390, Martin Schwidefsky,
Heiko Carstens
Cc: Danny Kukawka, linux-s390, David S. Miller, linux-kernel
Check if given address is valid in .ndo_set_mac_address/
qeth_l2_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/s390/net/qeth_l2_main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index e5c9cf1..d10b3a4 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -661,6 +661,9 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
struct qeth_card *card = dev->ml_priv;
int rc = 0;
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+
QETH_CARD_TEXT(card, 3, "setmac");
if (qeth_l2_verify_dev(dev) != QETH_REAL_CARD) {
--
1.7.8.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL
2012-02-24 16:01 [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL Danny Kukawka
2012-02-24 16:01 ` [PATCH 11/12] s390/net/qeth_l2_main: " Danny Kukawka
@ 2012-02-24 17:59 ` Michał Mirosław
2012-02-25 10:13 ` Geert Uytterhoeven
1 sibling, 1 reply; 5+ messages in thread
From: Michał Mirosław @ 2012-02-24 17:59 UTC (permalink / raw)
To: Danny Kukawka
Cc: David S. Miller, Andy Gospodarek, Guo-Fu Tseng, Petko Manolov,
VMware, Inc., John W. Linville, linux390, Mauro Carvalho Chehab,
Danny Kukawka, Stephen Hemminger, Joe Perches, Jeff Kirsher,
Jiri Pirko, netdev, linux-usb, linux-wireless, libertas-dev,
linux-kernel, linux-media, linux-s390, linux-hams, linux-mips
2012/2/24 Danny Kukawka <danny.kukawka@bisect.de>:
> Second Part of series patches to unifiy the return value of
> .ndo_set_mac_address if the given address isn't valid.
>
> These changes check if a given (MAC) address is valid in
> .ndo_set_mac_address, if invalid return -EADDRNOTAVAIL
> as eth_mac_addr() already does if is_valid_ether_addr() fails.
Why not just fix dev_set_mac_address() and make do_setlink() use that?
Checks are specific to address family, not device model I assume.
Best Regards,
Michał Mirosław
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL
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
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2012-02-25 10:13 UTC (permalink / raw)
To: Michał Mirosław
Cc: Danny Kukawka, David S. Miller, Andy Gospodarek, Guo-Fu Tseng,
Petko Manolov, VMware, Inc., John W. Linville, linux390,
Mauro Carvalho Chehab, Danny Kukawka, Stephen Hemminger,
Joe Perches, Jeff Kirsher, Jiri Pirko, netdev, linux-usb,
linux-wireless, libertas-dev, linux-kernel, linux-media,
linux-s390, linux-hams, linux-mips
2012/2/24 Michał Mirosław <mirqus@gmail.com>:
> 2012/2/24 Danny Kukawka <danny.kukawka@bisect.de>:
>> Second Part of series patches to unifiy the return value of
>> .ndo_set_mac_address if the given address isn't valid.
>>
>> These changes check if a given (MAC) address is valid in
>> .ndo_set_mac_address, if invalid return -EADDRNOTAVAIL
>> as eth_mac_addr() already does if is_valid_ether_addr() fails.
>
> Why not just fix dev_set_mac_address() and make do_setlink() use that?
BTW, it's also called from dev_set_mac_address().
> Checks are specific to address family, not device model I assume.
Indeed, why can't this be done in one single place, instead of sprinkling these
checks over all drivers, missing all out-of-tree (note: I don't care) and all
soon-to-be-submitted drivers?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL
2012-02-25 10:13 ` Geert Uytterhoeven
@ 2012-02-29 7:02 ` Danny Kukawka
0 siblings, 0 replies; 5+ messages in thread
From: Danny Kukawka @ 2012-02-29 7:02 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Michał Mirosław, David S. Miller, Andy Gospodarek,
Guo-Fu Tseng, Petko Manolov, VMware, Inc., John W. Linville,
linux390, Mauro Carvalho Chehab, Stephen Hemminger, Joe Perches,
Jeff Kirsher, Jiri Pirko, netdev, linux-usb, linux-wireless,
libertas-dev, linux-kernel, linux-media, linux-s390, linux-hams,
linux-mips
On Samstag, 25. Februar 2012, Geert Uytterhoeven wrote:
> 2012/2/24 Michał Mirosław <mirqus@gmail.com>:
> > 2012/2/24 Danny Kukawka <danny.kukawka@bisect.de>:
> >> Second Part of series patches to unifiy the return value of
> >> .ndo_set_mac_address if the given address isn't valid.
> >>
> >> These changes check if a given (MAC) address is valid in
> >> .ndo_set_mac_address, if invalid return -EADDRNOTAVAIL
> >> as eth_mac_addr() already does if is_valid_ether_addr() fails.
> >
> > Why not just fix dev_set_mac_address() and make do_setlink() use that?
>
> BTW, it's also called from dev_set_mac_address().
>
> > Checks are specific to address family, not device model I assume.
>
> Indeed, why can't this be done in one single place, instead of sprinkling
> these checks over all drivers, missing all out-of-tree (note: I don't care)
> and all soon-to-be-submitted drivers?
Since the .ndo_set_mac_address functions are used by some drivers internally
too, you may get some new checks on other places. But I'll take a look at it.
Danny
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-29 7:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24 16:01 [PATCH 00/12] Part 2: check given MAC address, if invalid return -EADDRNOTAVAIL Danny Kukawka
2012-02-24 16:01 ` [PATCH 11/12] s390/net/qeth_l2_main: " 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox