diff options
| author | Andi Kleen <ak@linux.intel.com> | 2008-07-21 18:16:54 -0400 | 
|---|---|---|
| committer | Andi Kleen <ak@linux.intel.com> | 2008-07-21 18:16:54 -0400 | 
| commit | 8294fafdafc602ed11f401c44628fab8558c5cf5 (patch) | |
| tree | c8d0371cfd05226b56d52bfde9c69f8caca4501d /net/ipv6/proc.c | |
| parent | 725c3a2d70f958adee807c178178819a50f68a56 (diff) | |
| parent | bf20e740a4bcc686de02e2fd1c1810a58872f46e (diff) | |
Merge branch 'for-upstream/acpi-test' of git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6 into release-2.6.27
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) | 
