lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 1 Jan 2019 10:40:22 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Kirill Tkhai <ktkhai@...tuozzo.com>,
        Murali Krishna Policharla <murali.policharla@...adcom.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "amritha.nambiar@...el.com" <amritha.nambiar@...el.com>,
        "ecree@...arflare.com" <ecree@...arflare.com>,
        "alexander.h.duyck@...el.com" <alexander.h.duyck@...el.com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: core: Fix to store new mtu setting in netdevice.

On 01.01.2019 08:54, Kirill Tkhai wrote:
> On 01.01.2019 09:42, Murali Krishna Policharla wrote:
>> Store newly configured mtu settings in the netdevice after mtu
>> configuration is successful to the dsa switch.
>>
>> Fixes: 2315dc91a5 ("net: make dev_set_mtu() honor notification return code")
>> Signed-off-by: Murali Krishna Policharla <murali.policharla@...adcom.com>
>> Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
>> ---
>>  net/core/dev.c | 9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 722d50d..58617aa 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -7586,12 +7586,15 @@ int dev_change_flags(struct net_device *dev, unsigned int flags)
>>  int __dev_set_mtu(struct net_device *dev, int new_mtu)
>>  {
>>  	const struct net_device_ops *ops = dev->netdev_ops;
>> +	int ret = 0;
>>  
>>  	if (ops->ndo_change_mtu)
>> -		return ops->ndo_change_mtu(dev, new_mtu);
> 
> Is there a .ndo_change_mtu callback, which does not assign a new mtu itself?
> 
So far all drivers have to do it themselves. But IMO this is more a workaround
for the core not doing it. It's something the core should do.
Now we can remove this from drivers.

>> +		ret = ops->ndo_change_mtu(dev, new_mtu);
>>  
>> -	dev->mtu = new_mtu;
>> -	return 0;
>> +	if (ret >= 0)
>> +		dev->mtu = new_mtu;
>> +
>> +	return ret;
>>  }
>>  EXPORT_SYMBOL(__dev_set_mtu);
>>  
>>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ