[NET]: Introduce union in struct dst_entry to hold 'next' pointer
authorEric Dumazet <dada1@cosmosbay.com>
Sat, 10 Feb 2007 00:14:24 +0000 (16:14 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 11 Feb 2007 07:20:36 +0000 (23:20 -0800)
This patch introduces an anonymous union to nicely express the fact that all
objects inherited from struct dst_entry should access to the generic 'next'
pointer but with appropriate type verification.

This patch is a prereq before following patches.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dst.h

index 62b7e7598e9adfbb246abb5a692515fbf0e99e0e..5d62342e8bc4c50762b00d7d716378379219253e 100644 (file)
@@ -37,7 +37,12 @@ struct sk_buff;
 
 struct dst_entry
 {
-       struct dst_entry        *next;
+       union {
+               struct dst_entry *next;
+               struct rtable    *rt_next;
+               struct rt6_info   *rt6_next;
+               struct dn_route  *dn_next;
+       };
        atomic_t                __refcnt;       /* client references    */
        int                     __use;
        struct dst_entry        *child;