]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/plip.c
ipv4: ip_ptr cleanups
[net-next-2.6.git] / drivers / net / plip.c
index 7e82a82422cffd0d248d164b137938f16cd6f4d9..ca4df7f4cf21df0099c883a2484c482e202246b0 100644 (file)
@@ -995,8 +995,10 @@ plip_tx_packet(struct sk_buff *skb, struct net_device *dev)
 static void
 plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth)
 {
-       const struct in_device *in_dev = dev->ip_ptr;
+       const struct in_device *in_dev;
 
+       rcu_read_lock();
+       in_dev = __in_dev_get_rcu(dev);
        if (in_dev) {
                /* Any address will do - we take the first */
                const struct in_ifaddr *ifa = in_dev->ifa_list;
@@ -1006,6 +1008,7 @@ plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth)
                        memcpy(eth->h_dest+2, &ifa->ifa_address, 4);
                }
        }
+       rcu_read_unlock();
 }
 
 static int
@@ -1088,7 +1091,8 @@ plip_open(struct net_device *dev)
           when the device address isn't identical to the address of a
           received frame, the kernel incorrectly drops it).             */
 
-       if ((in_dev=dev->ip_ptr) != NULL) {
+       in_dev=__in_dev_get_rtnl(dev);
+       if (in_dev) {
                /* Any address will do - we take the first. We already
                   have the first two bytes filled with 0xfc, from
                   plip_init_dev(). */