summaryrefslogtreecommitdiff
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-03-06 05:30:47 +0300
committerDavid S. Miller <davem@davemloft.net>2008-03-06 05:30:47 +0300
commitee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch)
tree197c2430f87733dc80d00d1971f1be2a0e562358 /include/linux/skbuff.h
parenta05c44f6d5fb6cd29da04f96bf5ffaa05f545ac5 (diff)
downloadlinux-ee6b967301b4aa5d4a4b61e2f682f086266db9fb.tar.xz
[IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts
(Anonymous) unions can help us to avoid ugly casts. A common cast it the (struct rtable *)skb->dst one. Defining an union like : union { struct dst_entry *dst; struct rtable *rtable; }; permits to use skb->rtable in place. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bbd8d0027e2f..7beb239d2ee0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -256,7 +256,10 @@ struct sk_buff {
ktime_t tstamp;
struct net_device *dev;
- struct dst_entry *dst;
+ union {
+ struct dst_entry *dst;
+ struct rtable *rtable;
+ };
struct sec_path *sp;
/*