diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
| commit | db6d8c7a4027b48d797b369a53f8470aaeed7063 (patch) | |
| tree | e140c104a89abc2154e1f41a7db8ebecbb6fa0b4 /net/ipv6/proc.c | |
| parent | 3a533374283aea50eab3976d8a6d30532175f009 (diff) | |
| parent | fb65a7c091529bfffb1262515252c0d0f6241c5c (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits)
iucv: Fix bad merging.
net_sched: Add size table for qdiscs
net_sched: Add accessor function for packet length for qdiscs
net_sched: Add qdisc_enqueue wrapper
highmem: Export totalhigh_pages.
ipv6 mcast: Omit redundant address family checks in ip6_mc_source().
net: Use standard structures for generic socket address structures.
ipv6 netns: Make several "global" sysctl variables namespace aware.
netns: Use net_eq() to compare net-namespaces for optimization.
ipv6: remove unused macros from net/ipv6.h
ipv6: remove unused parameter from ip6_ra_control
tcp: fix kernel panic with listening_get_next
tcp: Remove redundant checks when setting eff_sacks
tcp: options clean up
tcp: Fix MD5 signatures for non-linear skbs
sctp: Update sctp global memory limit allocations.
sctp: remove unnecessary byteshifting, calculate directly in big-endian
sctp: Allow only 1 listening socket with SO_REUSEADDR
sctp: Do not leak memory on multiple listen() calls
sctp: Support ipv6only AF_INET6 sockets.
...
Diffstat (limited to 'net/ipv6/proc.c')
| -rw-r--r-- | net/ipv6/proc.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index df0736a4cafa..f82f6074cf85 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | * PROC file system. This is very similar to the IPv4 version, | 7 | * PROC file system. This is very similar to the IPv4 version, |
| 8 | * except it reports the sockets in the INET6 address family. | 8 | * except it reports the sockets in the INET6 address family. |
| 9 | * | 9 | * |
| 10 | * Version: $Id: proc.c,v 1.17 2002/02/01 22:01:04 davem Exp $ | ||
| 11 | * | ||
| 12 | * Authors: David S. Miller (davem@caip.rutgers.edu) | 10 | * Authors: David S. Miller (davem@caip.rutgers.edu) |
| 13 | * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 11 | * YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> |
| 14 | * | 12 | * |
| @@ -185,32 +183,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v) | |||
| 185 | 183 | ||
| 186 | static int sockstat6_seq_open(struct inode *inode, struct file *file) | 184 | static int sockstat6_seq_open(struct inode *inode, struct file *file) |
| 187 | { | 185 | { |
| 188 | int err; | 186 | return single_open_net(inode, file, sockstat6_seq_show); |
| 189 | struct net *net; | ||
| 190 | |||
| 191 | err = -ENXIO; | ||
| 192 | net = get_proc_net(inode); | ||
| 193 | if (net == NULL) | ||
| 194 | goto err_net; | ||
| 195 | |||
| 196 | err = single_open(file, sockstat6_seq_show, net); | ||
| 197 | if (err < 0) | ||
| 198 | goto err_open; | ||
| 199 | |||
| 200 | return 0; | ||
| 201 | |||
| 202 | err_open: | ||
| 203 | put_net(net); | ||
| 204 | err_net: | ||
| 205 | return err; | ||
| 206 | } | ||
| 207 | |||
| 208 | static int sockstat6_seq_release(struct inode *inode, struct file *file) | ||
| 209 | { | ||
| 210 | struct net *net = ((struct seq_file *)file->private_data)->private; | ||
| 211 | |||
| 212 | put_net(net); | ||
| 213 | return single_release(inode, file); | ||
| 214 | } | 187 | } |
| 215 | 188 | ||
| 216 | static const struct file_operations sockstat6_seq_fops = { | 189 | static const struct file_operations sockstat6_seq_fops = { |
| @@ -218,7 +191,7 @@ static const struct file_operations sockstat6_seq_fops = { | |||
| 218 | .open = sockstat6_seq_open, | 191 | .open = sockstat6_seq_open, |
| 219 | .read = seq_read, | 192 | .read = seq_read, |
| 220 | .llseek = seq_lseek, | 193 | .llseek = seq_lseek, |
| 221 | .release = sockstat6_seq_release, | 194 | .release = single_release_net, |
| 222 | }; | 195 | }; |
| 223 | 196 | ||
| 224 | static int snmp6_seq_open(struct inode *inode, struct file *file) | 197 | static int snmp6_seq_open(struct inode *inode, struct file *file) |
| @@ -241,7 +214,7 @@ int snmp6_register_dev(struct inet6_dev *idev) | |||
| 241 | if (!idev || !idev->dev) | 214 | if (!idev || !idev->dev) |
| 242 | return -EINVAL; | 215 | return -EINVAL; |
| 243 | 216 | ||
| 244 | if (dev_net(idev->dev) != &init_net) | 217 | if (!net_eq(dev_net(idev->dev), &init_net)) |
| 245 | return 0; | 218 | return 0; |
| 246 | 219 | ||
| 247 | if (!proc_net_devsnmp6) | 220 | if (!proc_net_devsnmp6) |
