[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:

committed by
David S. Miller

parent
a05c44f6d5
commit
ee6b967301
@@ -948,7 +948,7 @@ int igmp_rcv(struct sk_buff *skb)
|
||||
case IGMPV2_HOST_MEMBERSHIP_REPORT:
|
||||
case IGMPV3_HOST_MEMBERSHIP_REPORT:
|
||||
/* Is it our report looped back? */
|
||||
if (((struct rtable*)skb->dst)->fl.iif == 0)
|
||||
if (skb->rtable->fl.iif == 0)
|
||||
break;
|
||||
/* don't rely on MC router hearing unicast reports */
|
||||
if (skb->pkt_type == PACKET_MULTICAST ||
|
||||
|
Reference in New Issue
Block a user