Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9355bbd685bf705a7f7bd6470b92ca0562c7a661
Commit:     9355bbd685bf705a7f7bd6470b92ca0562c7a661
Parent:     752d14dc6aa9d0fc8f3b25e5052596fb549e5157
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sun Dec 16 13:32:16 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:58:11 2008 -0800

    [IPV4]: Switch users of ipv4_devconf_dflt to use the pernet one
    
    They are all collected in the net/ipv4/devinet.c file and
    mostly use the IPV4_DEVCONF_DFLT macro.
    
    So I add the net parameter to it and patch users accordingly.
    
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/devinet.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a2d4817..4c01c55 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -83,7 +83,8 @@ static struct ipv4_devconf ipv4_devconf_dflt = {
        },
 };
 
-#define IPV4_DEVCONF_DFLT(attr) IPV4_DEVCONF(ipv4_devconf_dflt, attr)
+#define IPV4_DEVCONF_DFLT(net, attr) \
+       IPV4_DEVCONF((*net->ipv4.devconf_dflt), attr)
 
 static const struct nla_policy ifa_ipv4_policy[IFA_MAX+1] = {
        [IFA_LOCAL]             = { .type = NLA_U32 },
@@ -164,7 +165,8 @@ static struct in_device *inetdev_init(struct net_device 
*dev)
        if (!in_dev)
                goto out;
        INIT_RCU_HEAD(&in_dev->rcu_head);
-       memcpy(&in_dev->cnf, &ipv4_devconf_dflt, sizeof(in_dev->cnf));
+       memcpy(&in_dev->cnf, dev->nd_net->ipv4.devconf_dflt,
+                       sizeof(in_dev->cnf));
        in_dev->cnf.sysctl = NULL;
        in_dev->dev = dev;
        if ((in_dev->arp_parms = neigh_parms_alloc(dev, &arp_tbl)) == NULL)
@@ -1247,7 +1249,7 @@ static void devinet_copy_dflt_conf(struct net *net, int i)
                rcu_read_lock();
                in_dev = __in_dev_get_rcu(dev);
                if (in_dev && !test_bit(i, in_dev->cnf.state))
-                       in_dev->cnf.data[i] = ipv4_devconf_dflt.data[i];
+                       in_dev->cnf.data[i] = net->ipv4.devconf_dflt->data[i];
                rcu_read_unlock();
        }
        read_unlock(&dev_base_lock);
@@ -1259,7 +1261,7 @@ static void inet_forward_change(struct net *net)
        int on = IPV4_DEVCONF_ALL(FORWARDING);
 
        IPV4_DEVCONF_ALL(ACCEPT_REDIRECTS) = !on;
-       IPV4_DEVCONF_DFLT(FORWARDING) = on;
+       IPV4_DEVCONF_DFLT(net, FORWARDING) = on;
 
        read_lock(&dev_base_lock);
        for_each_netdev(net, dev) {
@@ -1288,7 +1290,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
 
                set_bit(i, cnf->state);
 
-               if (cnf == &ipv4_devconf_dflt)
+               if (cnf == net->ipv4.devconf_dflt)
                        devinet_copy_dflt_conf(net, i);
        }
 
@@ -1341,7 +1343,7 @@ static int devinet_conf_sysctl(ctl_table *table, int 
__user *name, int nlen,
 
        set_bit(i, cnf->state);
 
-       if (cnf == &ipv4_devconf_dflt)
+       if (cnf == net->ipv4.devconf_dflt)
                devinet_copy_dflt_conf(net, i);
 
        return 1;
@@ -1360,7 +1362,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int 
write,
 
                if (valp == &IPV4_DEVCONF_ALL(FORWARDING))
                        inet_forward_change(net);
-               else if (valp != &IPV4_DEVCONF_DFLT(FORWARDING))
+               else if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING))
                        rt_cache_flush(0);
        }
 
-
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