aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.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/ipmr.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/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index a94f52c207a7..7d63d74ef62a 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1283,7 +1283,7 @@ static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local
1283 if (vif_table[vif].dev != skb->dev) { 1283 if (vif_table[vif].dev != skb->dev) {
1284 int true_vifi; 1284 int true_vifi;
1285 1285
1286 if (((struct rtable*)skb->dst)->fl.iif == 0) { 1286 if (skb->rtable->fl.iif == 0) {
1287 /* It is our own packet, looped back. 1287 /* It is our own packet, looped back.
1288 Very complicated situation... 1288 Very complicated situation...
1289 1289
@@ -1357,7 +1357,7 @@ dont_forward:
1357int ip_mr_input(struct sk_buff *skb) 1357int ip_mr_input(struct sk_buff *skb)
1358{ 1358{
1359 struct mfc_cache *cache; 1359 struct mfc_cache *cache;
1360 int local = ((struct rtable*)skb->dst)->rt_flags&RTCF_LOCAL; 1360 int local = skb->rtable->rt_flags&RTCF_LOCAL;
1361 1361
1362 /* Packet is looped back after forward, it should not be 1362 /* Packet is looped back after forward, it should not be
1363 forwarded second time, but still can be delivered locally. 1363 forwarded second time, but still can be delivered locally.
@@ -1594,7 +1594,7 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait)
1594{ 1594{
1595 int err; 1595 int err;
1596 struct mfc_cache *cache; 1596 struct mfc_cache *cache;
1597 struct rtable *rt = (struct rtable*)skb->dst; 1597 struct rtable *rt = skb->rtable;
1598 1598
1599 read_lock(&mrt_lock); 1599 read_lock(&mrt_lock);
1600 cache = ipmr_cache_find(rt->rt_src, rt->rt_dst); 1600 cache = ipmr_cache_find(rt->rt_src, rt->rt_dst);