aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-03-05 21:30:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-05 21:30:47 -0500
commitee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch)
tree197c2430f87733dc80d00d1971f1be2a0e562358 /net/ipv4/ip_gre.c
parenta05c44f6d5fb6cd29da04f96bf5ffaa05f545ac5 (diff)
[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 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index e7821ba7a9a0..f9ee84420cb3 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -619,7 +619,7 @@ static int ipgre_rcv(struct sk_buff *skb)
619#ifdef CONFIG_NET_IPGRE_BROADCAST 619#ifdef CONFIG_NET_IPGRE_BROADCAST
620 if (ipv4_is_multicast(iph->daddr)) { 620 if (ipv4_is_multicast(iph->daddr)) {
621 /* Looped back packet, drop it! */ 621 /* Looped back packet, drop it! */
622 if (((struct rtable*)skb->dst)->fl.iif == 0) 622 if (skb->rtable->fl.iif == 0)
623 goto drop; 623 goto drop;
624 tunnel->stat.multicast++; 624 tunnel->stat.multicast++;
625 skb->pkt_type = PACKET_BROADCAST; 625 skb->pkt_type = PACKET_BROADCAST;
@@ -699,7 +699,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
699 } 699 }
700 700
701 if (skb->protocol == htons(ETH_P_IP)) { 701 if (skb->protocol == htons(ETH_P_IP)) {
702 rt = (struct rtable*)skb->dst; 702 rt = skb->rtable;
703 if ((dst = rt->rt_gateway) == 0) 703 if ((dst = rt->rt_gateway) == 0)
704 goto tx_error_icmp; 704 goto tx_error_icmp;
705 } 705 }