aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-10-13 03:17:25 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:22:07 -0500
commit7a3025b1b3a0173be5de6ced18754b909da27b38 (patch)
treedbb121ce5b9e2e97ee1e022093249eb2ed7cc3be
parent40aa7b90a9b41a2162c829fd6cd34a09056a7ddb (diff)
[IPV6]: Introduce ip6_dst_idev() to get inet6_dev{} stored in dst_entry{}.
Otherwise, we will see a lot of casts... Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
-rw-r--r--include/net/ip6_fib.h5
-rw-r--r--net/ipv6/addrconf.c2
-rw-r--r--net/ipv6/ip6_input.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index e4438de3bd6b..f9cde44f93b4 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -107,6 +107,11 @@ struct rt6_info
107 u8 rt6i_protocol; 107 u8 rt6i_protocol;
108}; 108};
109 109
110static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
111{
112 return ((struct rt6_info *)dst)->rt6i_idev;
113}
114
110struct fib6_walker_t 115struct fib6_walker_t
111{ 116{
112 struct fib6_walker_t *prev, *next; 117 struct fib6_walker_t *prev, *next;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index b312a5f7a759..6a98f68348cb 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1164,7 +1164,7 @@ record_it:
1164int ipv6_get_saddr(struct dst_entry *dst, 1164int ipv6_get_saddr(struct dst_entry *dst,
1165 struct in6_addr *daddr, struct in6_addr *saddr) 1165 struct in6_addr *daddr, struct in6_addr *saddr)
1166{ 1166{
1167 return ipv6_dev_get_saddr(dst ? ((struct rt6_info *)dst)->rt6i_idev->dev : NULL, daddr, saddr); 1167 return ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, daddr, saddr);
1168} 1168}
1169 1169
1170 1170
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 6b8e6d76a58b..ebf54ae90a0c 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -84,7 +84,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
84 * arrived via the sending interface (ethX), because of the 84 * arrived via the sending interface (ethX), because of the
85 * nature of scoping architecture. --yoshfuji 85 * nature of scoping architecture. --yoshfuji
86 */ 86 */
87 IP6CB(skb)->iif = skb->dst ? ((struct rt6_info *)skb->dst)->rt6i_idev->dev->ifindex : dev->ifindex; 87 IP6CB(skb)->iif = skb->dst ? ip6_dst_idev(skb->dst)->dev->ifindex : dev->ifindex;
88 88
89 if (unlikely(!pskb_may_pull(skb, sizeof(*hdr)))) 89 if (unlikely(!pskb_may_pull(skb, sizeof(*hdr))))
90 goto err; 90 goto err;