diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-02 01:19:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-03 05:51:04 -0400 |
commit | adf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch) | |
tree | 0f07542bb95de2ad537540868aba6cf87a86e17d /net/ipv6/route.c | |
parent | 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (diff) |
net: skb->dst accessors
Define three accessors to get/set dst attached to a skb
struct dst_entry *skb_dst(const struct sk_buff *skb)
void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
void skb_dst_drop(struct sk_buff *skb)
This one should replace occurrences of :
dst_release(skb->dst)
skb->dst = NULL;
Delete skb->dst field
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 032a5ec391c5..658293ea05ba 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -800,7 +800,7 @@ void ip6_route_input(struct sk_buff *skb) | |||
800 | if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG) | 800 | if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG) |
801 | flags |= RT6_LOOKUP_F_IFACE; | 801 | flags |= RT6_LOOKUP_F_IFACE; |
802 | 802 | ||
803 | skb->dst = fib6_rule_lookup(net, &fl, flags, ip6_pol_route_input); | 803 | skb_dst_set(skb, fib6_rule_lookup(net, &fl, flags, ip6_pol_route_input)); |
804 | } | 804 | } |
805 | 805 | ||
806 | static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, | 806 | static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, |
@@ -911,7 +911,7 @@ static void ip6_link_failure(struct sk_buff *skb) | |||
911 | 911 | ||
912 | icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0, skb->dev); | 912 | icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0, skb->dev); |
913 | 913 | ||
914 | rt = (struct rt6_info *) skb->dst; | 914 | rt = (struct rt6_info *) skb_dst(skb); |
915 | if (rt) { | 915 | if (rt) { |
916 | if (rt->rt6i_flags&RTF_CACHE) { | 916 | if (rt->rt6i_flags&RTF_CACHE) { |
917 | dst_set_expires(&rt->u.dst, 0); | 917 | dst_set_expires(&rt->u.dst, 0); |
@@ -1868,7 +1868,7 @@ int ipv6_route_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
1868 | static int ip6_pkt_drop(struct sk_buff *skb, int code, int ipstats_mib_noroutes) | 1868 | static int ip6_pkt_drop(struct sk_buff *skb, int code, int ipstats_mib_noroutes) |
1869 | { | 1869 | { |
1870 | int type; | 1870 | int type; |
1871 | struct dst_entry *dst = skb->dst; | 1871 | struct dst_entry *dst = skb_dst(skb); |
1872 | switch (ipstats_mib_noroutes) { | 1872 | switch (ipstats_mib_noroutes) { |
1873 | case IPSTATS_MIB_INNOROUTES: | 1873 | case IPSTATS_MIB_INNOROUTES: |
1874 | type = ipv6_addr_type(&ipv6_hdr(skb)->daddr); | 1874 | type = ipv6_addr_type(&ipv6_hdr(skb)->daddr); |
@@ -1895,7 +1895,7 @@ static int ip6_pkt_discard(struct sk_buff *skb) | |||
1895 | 1895 | ||
1896 | static int ip6_pkt_discard_out(struct sk_buff *skb) | 1896 | static int ip6_pkt_discard_out(struct sk_buff *skb) |
1897 | { | 1897 | { |
1898 | skb->dev = skb->dst->dev; | 1898 | skb->dev = skb_dst(skb)->dev; |
1899 | return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_OUTNOROUTES); | 1899 | return ip6_pkt_drop(skb, ICMPV6_NOROUTE, IPSTATS_MIB_OUTNOROUTES); |
1900 | } | 1900 | } |
1901 | 1901 | ||
@@ -1908,7 +1908,7 @@ static int ip6_pkt_prohibit(struct sk_buff *skb) | |||
1908 | 1908 | ||
1909 | static int ip6_pkt_prohibit_out(struct sk_buff *skb) | 1909 | static int ip6_pkt_prohibit_out(struct sk_buff *skb) |
1910 | { | 1910 | { |
1911 | skb->dev = skb->dst->dev; | 1911 | skb->dev = skb_dst(skb)->dev; |
1912 | return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); | 1912 | return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); |
1913 | } | 1913 | } |
1914 | 1914 | ||
@@ -2366,7 +2366,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void | |||
2366 | skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); | 2366 | skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); |
2367 | 2367 | ||
2368 | rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl); | 2368 | rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl); |
2369 | skb->dst = &rt->u.dst; | 2369 | skb_dst_set(skb, &rt->u.dst); |
2370 | 2370 | ||
2371 | err = rt6_fill_node(net, skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, | 2371 | err = rt6_fill_node(net, skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, |
2372 | RTM_NEWROUTE, NETLINK_CB(in_skb).pid, | 2372 | RTM_NEWROUTE, NETLINK_CB(in_skb).pid, |