[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>
This commit is contained in:
Eric Dumazet
2008-03-05 18:30:47 -08:00
committed by David S. Miller
parent a05c44f6d5
commit ee6b967301
23 changed files with 69 additions and 68 deletions

View File

@@ -256,10 +256,10 @@ META_COLLECTOR(int_rtclassid)
META_COLLECTOR(int_rtiif)
{
if (unlikely(skb->dst == NULL))
if (unlikely(skb->rtable == NULL))
*err = -1;
else
dst->value = ((struct rtable*) skb->dst)->fl.iif;
dst->value = skb->rtable->fl.iif;
}
/**************************************************************************