Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=790a35328991b01181ff5624bdb084053b6fac54
Commit:     790a35328991b01181ff5624bdb084053b6fac54
Parent:     024626e36d75fc8c6e32d50d4c68bfc3b8df5fdf
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 8 00:11:51 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:56:56 2008 -0800

    [NET] sysctl: prepare core tables to point to netns variables
    
    Some of ctl variables are going to be on the struct
    net. Here's the way to adjust the ->data pointer on the
    ctl_table-s to point on the right variable.
    
    Since some pointers still point on the global variables,
    I keep turning the write bits off on such tables.
    
    This looks to become a common procedure for net sysctls,
    so later parts of this code may migrate to some more
    generic place.
    
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/sysctl_net_core.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 57a7ead..dc4cf7d 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -167,8 +167,13 @@ static __net_init int sysctl_core_net_init(struct net *net)
                if (tbl == NULL)
                        goto err_dup;
 
-               for (tmp = tbl; tmp->procname; tmp++)
-                       tmp->mode &= ~0222;
+               for (tmp = tbl; tmp->procname; tmp++) {
+                       if (tmp->data >= (void *)&init_net &&
+                                       tmp->data < (void *)(&init_net + 1))
+                               tmp->data += (char *)net - (char *)&init_net;
+                       else
+                               tmp->mode &= ~0222;
+               }
        }
 
        net->sysctl_core_hdr = register_net_sysctl_table(net,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to