This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / linux / inetdevice.h
index 6fafb27..92297ff 100644 (file)
@@ -25,10 +25,12 @@ struct ipv4_devconf
        int     arp_filter;
        int     arp_announce;
        int     arp_ignore;
+       int     arp_accept;
        int     medium_id;
        int     no_xfrm;
        int     no_policy;
        int     force_igmp_version;
+       int     promote_secondaries;
        void    *sysctl;
 };
 
@@ -71,6 +73,7 @@ struct in_device
 #define IN_DEV_SEC_REDIRECTS(in_dev)   (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects)
 #define IN_DEV_IDTAG(in_dev)           ((in_dev)->cnf.tag)
 #define IN_DEV_MEDIUM_ID(in_dev)       ((in_dev)->cnf.medium_id)
+#define IN_DEV_PROMOTE_SECONDARIES(in_dev)     (ipv4_devconf.promote_secondaries || (in_dev)->cnf.promote_secondaries)
 
 #define IN_DEV_RX_REDIRECTS(in_dev) \
        ((IN_DEV_FORWARD(in_dev) && \
@@ -140,13 +143,21 @@ static __inline__ int bad_mask(u32 mask, u32 addr)
 
 #define endfor_ifa(in_dev) }
 
+static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
+{
+       struct in_device *in_dev = dev->ip_ptr;
+       if (in_dev)
+               in_dev = rcu_dereference(in_dev);
+       return in_dev;
+}
+
 static __inline__ struct in_device *
 in_dev_get(const struct net_device *dev)
 {
        struct in_device *in_dev;
 
        rcu_read_lock();
-       in_dev = dev->ip_ptr;
+       in_dev = __in_dev_get_rcu(dev);
        if (in_dev)
                atomic_inc(&in_dev->refcnt);
        rcu_read_unlock();
@@ -154,7 +165,7 @@ in_dev_get(const struct net_device *dev)
 }
 
 static __inline__ struct in_device *
-__in_dev_get(const struct net_device *dev)
+__in_dev_get_rtnl(const struct net_device *dev)
 {
        return (struct in_device*)dev->ip_ptr;
 }