summaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-15 02:58:39 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-17 19:21:09 -0700
commite3c50d5d25ac09efd9acbe2b2a3e365466de84ed (patch)
treedc5bc3322f9e4829c2143fc4fc60532fd84ab9a1 /include/linux/netdevice.h
parent6b0fb1261a4655613bed5dac0e935e733969e999 (diff)
netdev: netdev_priv() can now be sane again.
The private area of a netdev is now at a fixed offset once more. Unfortunately, some assumptions that netdev_priv() == netdev->priv crept back into the tree. In particular this happened in the loopback driver. Make it use netdev->ml_priv. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a1c2c220449..fdac1159253 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -808,7 +808,9 @@ void dev_net_set(struct net_device *dev, struct net *net)
*/
static inline void *netdev_priv(const struct net_device *dev)
{
- return dev->priv;
+ return (char *)dev + ((sizeof(struct net_device)
+ + NETDEV_ALIGN_CONST)
+ & ~NETDEV_ALIGN_CONST);
}
/* Set the sysfs physical device reference for the network logical device