Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 305503 Details for
Bug 446456
RFE: add ability to reset interface stats via procfs
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Updated patch
add-clear-stats-proc-net-dev-2.6.9.patch (text/plain), 2.32 KB, created by
James Cammarata
on 2008-05-15 15:49:54 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
James Cammarata
Created:
2008-05-15 15:49:54 UTC
Size:
2.32 KB
patch
obsolete
>--- linux-2.6.9-original/net/core/dev.c 2004-10-18 17:54:08.000000000 -0400 >+++ linux-2.6.9/net/core/dev.c 2008-05-15 07:26:57.000000000 -0400 >@@ -2146,6 +2146,56 @@ static int softnet_seq_show(struct seq_f > return 0; > } > >+static ssize_t proc_net_dev_write(struct file *file, const char __user *buf, size_t length, loff_t *ppos) >+{ >+ char *buffer, *p; >+ char devname[IFNAMSIZ]; >+ struct net_device *dev; >+ int err; >+ >+ if (!buf || length > PAGE_SIZE) >+ return -EINVAL; >+ >+ buffer = (char *)__get_free_page(GFP_KERNEL); >+ if (!buffer) >+ return -ENOMEM; >+ >+ err = -EFAULT; >+ if (copy_from_user(buffer, buf, length)) >+ goto out; >+ >+ err = -EINVAL; >+ if (length < PAGE_SIZE) >+ buffer[length] = '\0'; >+ else if (buffer[PAGE_SIZE-1]) >+ goto out; >+ >+ /* >+ * Usage: echo "net clear-stats ifdev" >/proc/net/dev >+ * with "ifdev" replaced by the device name you wish to clear. >+ */ >+ if (!strncmp("net clear-stats",buffer,15)) { >+ p = buffer + 16; >+ if (sscanf(p,"%16s",devname) > 0) { >+ dev = dev_get_by_name(devname); >+ if (dev) { >+ if (dev->get_stats) { >+ struct net_device_stats *stats = dev->get_stats(dev); >+ memset(stats,0,sizeof(struct net_device_stats)); >+ printk(KERN_INFO "stats cleared for interface %s\n", devname); >+ } else { >+ printk(KERN_INFO "%s has no stats to clear\n", devname); >+ } >+ dev_put(dev); >+ } >+ } >+ } >+ >+ out: >+ free_page((unsigned long)buffer); >+ return err; >+} >+ > static struct seq_operations dev_seq_ops = { > .start = dev_seq_start, > .next = dev_seq_next, >@@ -2162,6 +2212,7 @@ static struct file_operations dev_seq_fo > .owner = THIS_MODULE, > .open = dev_seq_open, > .read = seq_read, >+ .write = proc_net_dev_write, > .llseek = seq_lseek, > .release = seq_release, > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 446456
:
305385
| 305503