Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next-2.6 3/6] be2net: check for valid ether address
@ 2009-11-30  3:56 Ajit Khaparde
  2009-12-02  9:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ajit Khaparde @ 2009-11-30  3:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Allow only valid ether addresses to be assigned and used for the interface.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 drivers/net/benet/be_main.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index e24f498..10262fa 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -125,6 +125,9 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
 	struct sockaddr *addr = p;
 	int status = 0;
 
+	if (!is_valid_ether_addr(addr->sa_data))
+		return -EADDRNOTAVAIL;
+
 	status = be_cmd_pmac_del(adapter, adapter->if_handle, adapter->pmac_id);
 	if (status)
 		return status;
@@ -2146,6 +2149,10 @@ static int be_get_config(struct be_adapter *adapter)
 			MAC_ADDRESS_TYPE_NETWORK, true /*permanent */, 0);
 	if (status)
 		return status;
+
+	if (!is_valid_ether_addr(mac))
+		return -EADDRNOTAVAIL;
+
 	memcpy(adapter->netdev->dev_addr, mac, ETH_ALEN);
 	memcpy(adapter->netdev->perm_addr, mac, ETH_ALEN);
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-02  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30  3:56 [PATCH net-next-2.6 3/6] be2net: check for valid ether address Ajit Khaparde
2009-12-02  9:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox