Messages in this thread Patch in this message | | | From | Danny Kukawka <> | Subject | [PATCH 11/12] s390/net/qeth_l2_main: check given MAC address, if invalid return -EADDRNOTAVAIL | Date | Fri, 24 Feb 2012 17:01:21 +0100 |
| |
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
| |