From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6A6D28389; Tue, 10 Sep 2024 14:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725976912; cv=none; b=EI6cVCQPlTlJFwHhKAZtSA/GN17+bkddDVK43cYKdOo2Df/Ww+Bp+MV1ovTzTdvdczswN6W4PE/dFeleWS+KQJrj70PhZvXSTMqSkaO6D8fGmO3Ypfezi0ifV9L1X9+x6RaefxjQve7mwdFFydVrgYNgcJ2tEj6GJQUnlWsDmj8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725976912; c=relaxed/simple; bh=TYpAFq6aic5D7srGX0t+w6AxJBY5RB4/w90GwvIBMR8=; h=Message-ID:Date:MIME-Version:CC:Subject:To:References:From: In-Reply-To:Content-Type; b=BfEsqv0C7h23JrzYgH4Z3GaCtMmx2gRlVUN0XchcpjX2Vqls6239zAp5miRJkkDqlmcUnA7HVzUOD4C77zVf2Cv11jAxRDtGcwFFrkM4+zpOTOsAR6AfJIM3v1EdoqfZMSLzkWHYWzdJ7IPUelt7f8k3XzjNLX73awqb93lR/8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4X353S4F0vz20nmx; Tue, 10 Sep 2024 22:01:40 +0800 (CST) Received: from kwepemm000007.china.huawei.com (unknown [7.193.23.189]) by mail.maildlp.com (Postfix) with ESMTPS id 977681A016C; Tue, 10 Sep 2024 22:01:45 +0800 (CST) Received: from [10.67.120.192] (10.67.120.192) by kwepemm000007.china.huawei.com (7.193.23.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 10 Sep 2024 22:01:44 +0800 Message-ID: Date: Tue, 10 Sep 2024 22:01:44 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH V9 net-next 11/11] net: add ndo_validate_addr check in dev_set_mac_address To: Kalesh Anakkur Purayil References: <20240910075942.1270054-1-shaojijie@huawei.com> <20240910075942.1270054-12-shaojijie@huawei.com> From: Jijie Shao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm000007.china.huawei.com (7.193.23.189) on 2024/9/10 16:39, Kalesh Anakkur Purayil wrote: > On Tue, Sep 10, 2024 at 1:36 PM Jijie Shao wrote: >> +++ b/net/core/dev.c >> @@ -9087,6 +9087,11 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa, >> return -EOPNOTSUPP; >> if (sa->sa_family != dev->type) >> return -EINVAL; >> + if (ops->ndo_validate_addr) { >> + err = ops->ndo_validate_addr(dev); >> + if (err) >> + return err; >> + } > [Kalesh] It would be better to move this code after > netif_device_present() check. Minor nit and there will not be any > functional impact. Yes, You are right, For other reasons I need to send v10, I will move it. Thanks, Jijie Shao