Subject: Re: [PATCH updated] net: add ability to clear per-interface network statistics via procfs

From: Patrick McHardy <[email-masked]>
Date: Sun, 18 May 2008 03:43:14 +0200

Ben Hutchings wrote:
>> +                        dev = dev_get_by_name(net,devname);
>> +                        if (dev) {
>> +                                if (dev->get_stats) {
>> +                                        struct net_device_stats *stats =
>> +                                               dev->get_stats(dev);
>> +                                        memset(stats,0,
>> +                                               sizeof(struct 
>> net_device_stats));

This doesn't work for devices that generate the stats (for
example by reading them from the hardware) in ->get_stats().