diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-15 05:58:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-17 22:21:09 -0400 |
commit | e3c50d5d25ac09efd9acbe2b2a3e365466de84ed (patch) | |
tree | dc5bc3322f9e4829c2143fc4fc60532fd84ab9a1 /include/linux | |
parent | 6b0fb1261a4655613bed5dac0e935e733969e999 (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')
-rw-r--r-- | include/linux/netdevice.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a1c2c2204498..fdac1159253e 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) | |||
808 | */ | 808 | */ |
809 | static inline void *netdev_priv(const struct net_device *dev) | 809 | static inline void *netdev_priv(const struct net_device *dev) |
810 | { | 810 | { |
811 | return dev->priv; | 811 | return (char *)dev + ((sizeof(struct net_device) |
812 | + NETDEV_ALIGN_CONST) | ||
813 | & ~NETDEV_ALIGN_CONST); | ||
812 | } | 814 | } |
813 | 815 | ||
814 | /* Set the sysfs physical device reference for the network logical device | 816 | /* Set the sysfs physical device reference for the network logical device |